@Override public void writeBytes(byte[] v, int off, int len) throws IOException { if (v == null) { output.writeInt(-1); } else { output.writeInt(len); output.write(v, off, len); } }
private void safeWriteToOutput(Output output, BaseProtocol.JobResult<?> jobResult) throws IOException { ByteArrayOutputStream boas = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(boas); oos.writeObject(jobResult); oos.flush(); output.write(boas.toByteArray()); output.flush(); }
public void write(Kryo kryo, Output output, BytesWritable object) { output.writeVarInt(object.getLength(), true); output.write(object.getBytes(), 0, object.getLength()); }
@Override public void write(Kryo kryo, Output output, PercentileCounter counter) { int length = counter.getRegisters().byteSize(); ByteBuffer buffer = ByteBuffer.allocate(length); counter.getRegisters().asSmallBytes(buffer); output.writeDouble(counter.getCompression()); output.writeDouble(counter.getQuantileRatio()); output.writeInt(buffer.position()); output.write(buffer.array(), 0, buffer.position()); }
@Override public void writeBytes(byte[] v, int off, int len) throws IOException { if (v == null) { output.writeInt(-1); } else { output.writeInt(len); output.write(v, off, len); } }
public void write(Kryo kryo, Output output, HiveKey object) { output.writeVarInt(object.getLength(), true); output.write(object.getBytes(), 0, object.getLength()); output.writeVarInt(object.hashCode(), false); }
@Override public void write(Kryo kryo, Output output, ByteBuffer object) { output.writeInt(object.array().length); output.write(object.array()); }
private void writeRectangle(Output output, S g) { Rectangle r = (Rectangle) g; output.write(0); writeBounds(output, r); }
public void write(Kryo kryo, Output output, HiveKey object) { output.writeVarInt(object.getLength(), true); output.write(object.getBytes(), 0, object.getLength()); }
@Override public void write(Kryo kryo, Output output, TupleImpl tuple) { byte[] bytes = tupleSerializer.serialize(tuple); output.writeInt(bytes.length); output.write(bytes); }
public void write(Kryo kryo, Output output, PyObject po) { try { byte[] serPo = SerializationUtils.serializeObject(po); output.writeInt(serPo.length); output.write(serPo); } catch (IOException e) { throw new KryoException("Failed to serialize object.", e); } }
@Override public void write(Kryo kryo, Output output, TestRecord object) { output.writeInt(object.buffer.length); output.write(object.buffer); }
public void writeBytes (String s) throws IOException { int len = s.length(); for (int i = 0; i < len; i++) { output.write((byte)s.charAt(i)); } }
public void writeBytes(byte[] v, int off, int len) throws IOException { if (v == null) { output.writeInt(-1); } else { output.writeInt(len); output.write(v, off, len); } }
public void writeBytes (String s) throws IOException { int len = s.length(); for (int i = 0; i < len; i++) { output.write((byte)s.charAt(i)); } }
@Override public void writeBytes(byte[] v, int off, int len) throws IOException { if (v == null) { output.writeInt(-1); } else { output.writeInt(len); output.write(v, off, len); } }
public void writeBytes (String s) throws IOException { int len = s.length(); for (int i = 0; i < len; i++) { output.write((byte)s.charAt(i)); } }