@Override public void writeChar(int v) { try { output.writeChar(v); } catch (IOException impossible) { throw new AssertionError(impossible); } }
@Override public void writeChar(int v) { try { output.writeChar(v); } catch (IOException impossible) { throw new AssertionError(impossible); } }
public DataOutputX writeChar(int v) throws IOException { this.written += 2; this.inner.writeChar(v); return this; }
public DataOutputX writeChar(int v) throws IOException { this.written += 2; this.inner.writeChar(v); return this; }
private void writeCharArray(DataOutput out) throws IOException { char[] v = (char[]) value; for (int i = 0; i < length; i++) out.writeChar(v[i]); }
public DataOutputX writeChar(int v) throws IOException { this.written += 2; this.inner.writeChar(v); return this; }
public DataOutputX writeChar(int v) throws IOException { this.written += 2; this.inner.writeChar(v); return this; }
public DataOutputX writeChar(int v) throws IOException { this.written += 2; this.inner.writeChar(v); return this; }
@Override public void writeChar(int v) { try { output.writeChar(v); } catch (IOException impossible) { throw new AssertionError(impossible); } }
@Override public void writeChar(int v) { try { output.writeChar(v); } catch (IOException impossible) { throw new AssertionError(impossible); } }
/** * Writes an instance of <code>Character</code> to a <code>DataOutput</code>. * * @throws IOException A problem occurs while writing to <code>out</code> * @throws NullPointerException if value is null. * * @see #readCharacter */ public static void writeCharacter(Character value, DataOutput out) throws IOException { InternalDataSerializer.checkOut(out); if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) { logger.trace(LogMarker.SERIALIZER_VERBOSE, "Writing Character {}", value); } out.writeChar(value.charValue()); }
/** * Writes a primitive <code>char</code> to a <code>DataOutput</code>. * * @throws IOException A problem occurs while writing to <code>out</code> * * @see DataOutput#writeChar * @since GemFire 5.1 */ public static void writePrimitiveChar(char value, DataOutput out) throws IOException { InternalDataSerializer.checkOut(out); if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) { logger.trace(LogMarker.SERIALIZER_VERBOSE, "Writing Char {}", value); } out.writeChar(value); }
break; case TYPE_CHAR: out.writeChar((Character)obj); break; case TYPE_DOUBLE:
out.writeBoolean(((Boolean)instance).booleanValue()); } else if (declaredClass == Character.TYPE) { // char out.writeChar(((Character)instance).charValue()); } else if (declaredClass == Byte.TYPE) { // byte out.writeByte(((Byte)instance).byteValue());
/** * Writes given number of characters from array of {@code char}s to a {@code DataOutput}. * * @throws IOException A problem occurs while writing to {@code out} * @see DataSerializer#readCharArray * @since GemFire 6.6 */ public static void writeCharArray(char[] array, DataOutput out) throws IOException { checkOut(out); if (array == null) { writeArrayLength(-1, out); } else { final int length = array.length; if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) { logger.trace(LogMarker.SERIALIZER_VERBOSE, "Writing char array of length {}", length); } writeArrayLength(length, out); for (char character : array) { out.writeChar(character); } } }
break; case 8: out.writeChar((char)r.nextInt()); break; case 9:
/** Stores an array to a given data output. * * @param array an array whose elements will be written to {@code dataOutput}. * @param dataOutput a data output. */ public static void storeChars(final char array[], final DataOutput dataOutput) throws IOException { final int length = array.length; for(int i = 0; i < length; i++) dataOutput.writeChar(array[i]); } /** Stores an array fragment to a file given by a {@link File} object.
/** Stores an array fragment to a given data output. * * @param array an array whose elements will be written to {@code dataOutput}. * @param offset the index of the first element of {@code array} to be written. * @param length the number of elements of {@code array} to be written. * @param dataOutput a data output. */ public static void storeChars(final char array[], final int offset, final int length, final DataOutput dataOutput) throws IOException { it.unimi.dsi.fastutil.chars.CharArrays.ensureOffsetLength(array, offset, length); for(int i = 0; i < length; i++) dataOutput.writeChar(array[offset + i]); } /** Stores an array to a given data output.
/** Stores the element returned by an iterator to a given data output. * * @param i an iterator whose output will be written to {@code dataOutput}. * @param dataOutput a filename. */ public static void storeChars(final CharIterator i, final DataOutput dataOutput) throws IOException { while(i.hasNext()) dataOutput.writeChar(i.nextChar()); } /** Stores the element returned by an iterator to a file given by a {@link File} object.