@Override public void write(DataOutputView out) throws IOException { out.writeInt(position); for (int i = 0; i < position; i++) { out.writeLong(data[i]); } }
@Override public void write(DataOutputView out) throws IOException { // write 4 bytes out.writeInt(42); }
@Override public void write(DataOutputView out) throws IOException { out.writeInt(position); for (int i = 0; i < position; i++) { out.writeFloat(data[i]); } }
@Override public void serialize(char[] record, DataOutputView target) throws IOException { if (record == null) { throw new IllegalArgumentException("The record must not be null."); } final int len = record.length; target.writeInt(len); for (int i = 0; i < len; i++) { target.writeChar(record[i]); } }
@Override public void serialize(short[] record, DataOutputView target) throws IOException { if (record == null) { throw new IllegalArgumentException("The record must not be null."); } final int len = record.length; target.writeInt(len); for (int i = 0; i < len; i++) { target.writeShort(record[i]); } }
@Override public void write(final DataOutputView out) throws IOException { out.writeInt(this.list.size()); for (final V value : this.list) { value.write(out); } }
@Override public void write(DataOutputView out) throws IOException { out.writeInt(position); for (int i = 0; i < position; i++) { out.writeShort(data[i]); } }
protected static void copyInternal(DataInputView source, DataOutputView target) throws IOException { int count = source.readInt(); target.writeInt(count); int bytes = ELEMENT_LENGTH_IN_BYTES * count; target.write(source, bytes); }
protected static void copyInternal(DataInputView source, DataOutputView target) throws IOException { int count = source.readInt(); target.writeInt(count); int bytes = ELEMENT_LENGTH_IN_BYTES * count; target.write(source, bytes); }
protected static void copyInternal(DataInputView source, DataOutputView target) throws IOException { int count = source.readInt(); target.writeInt(count); int bytes = ELEMENT_LENGTH_IN_BYTES * count; target.write(source, bytes); }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { final int len = source.readInt(); target.writeInt(len); target.write(source, len * 2); }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { final int len = source.readInt(); target.writeInt(len); target.write(source, len * 2); }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { final int len = source.readInt(); target.writeInt(len); target.write(source, len * 4); }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { final int len = source.readInt(); target.writeInt(len); target.write(source, len); }
/** * Writes the given snapshot to the out stream. One should always use this method to write * snapshots out, rather than directly calling {@link #writeSnapshot(DataOutputView)}. * * <p>The snapshot written with this method can be read via {@link #readVersionedSnapshot(DataInputView, ClassLoader)}. */ static void writeVersionedSnapshot(DataOutputView out, TypeSerializerSnapshot<?> snapshot) throws IOException { out.writeUTF(snapshot.getClass().getName()); out.writeInt(snapshot.getCurrentVersion()); snapshot.writeSnapshot(out); }
@Override public void write(DataOutputView out) throws IOException { out.writeInt(this.data.length); out.write(this.data); }
@Override public void write(DataOutputView out) throws IOException { out.writeInt(this.coordinates.length); for (int i = 0; i < this.coordinates.length; i++) { out.writeDouble(this.coordinates[i]); } }
@Override public void serialize(ElementType record, DataOutputView target) throws IOException { if (failOnWrite) { throw new TestException(); } target.writeInt(record.getId()); }