public void writeUnsignedInt(long offset, long v) { wrapped.writeUnsignedInt(offset, v); }
public void writeUnsignedInt(long v) { wrapped.writeUnsignedInt(v); }
public void writeUnsignedInt(long v) { wrapped.writeUnsignedInt(v); }
public void writeUnsignedInt(long offset, long v) { wrapped.writeUnsignedInt(offset, v); }
public void writeUnsignedInt(long offset, long v) { this.checkNotClosed(); this.bytes.writeUnsignedInt(offset, v); }
public void writeUnsignedInt(long offset, long v) { this.checkNotClosed(); this.bytes.writeUnsignedInt(offset, v); }
public void writeUnsignedInt(long v) { this.checkNotClosed(); this.bytes.writeUnsignedInt(v); }
public void writeUnsignedInt(long v) { this.checkNotClosed(); this.bytes.writeUnsignedInt(v); }
@Override public void writeSerializable(Bytes bytes, Object object, Class expectedClass) throws IOException { // reset the finished flag and append long position = bytes.position(); bytes.clear(); bytes.position(position + 4); OutputStream out = bytes.outputStream(); ObjectOutputStream oos = new ObjectOutputStream(new DeflaterOutputStream(out)); oos.writeObject(object); oos.close(); long length = bytes.position() - position - 4; bytes.writeUnsignedInt(position, length); }
@Override public void writeSerializable(Bytes bytes, Object object, Class expectedClass) throws IOException { // reset the finished flag and append long position = bytes.position(); bytes.clear(); bytes.position(position + 4); OutputStream out = bytes.outputStream(); ObjectOutputStream oos = new ObjectOutputStream(new DeflaterOutputStream(out)); oos.writeObject(object); oos.close(); long length = bytes.position() - position - 4; bytes.writeUnsignedInt(position, length); }
@Override public void write(Bytes bytes, ByteBuffer byteBuffer) { bytes.writeStopBit(byteBuffer.remaining()); long position = bytes.position(); bytes.clear(); bytes.position(position + 4); DataOutputStream dos = new DataOutputStream(new DeflaterOutputStream(bytes.outputStream())); try { while (byteBuffer.remaining() >= 8) dos.writeLong(byteBuffer.getLong()); while (byteBuffer.remaining() > 0) dos.write(byteBuffer.get()); dos.close(); } catch (IOException e) { throw new IllegalStateException(e); } bytes.writeUnsignedInt(position, bytes.position() - position - 4); bytes.write(byteBuffer); }
@Override public void write(Bytes bytes, ByteBuffer byteBuffer) { bytes.writeStopBit(byteBuffer.remaining()); long position = bytes.position(); bytes.clear(); bytes.position(position + 4); DataOutputStream dos = new DataOutputStream(new DeflaterOutputStream(bytes.outputStream())); try { while (byteBuffer.remaining() >= 8) dos.writeLong(byteBuffer.getLong()); while (byteBuffer.remaining() > 0) dos.write(byteBuffer.get()); dos.close(); } catch (IOException e) { throw new IllegalStateException(e); } bytes.writeUnsignedInt(position, bytes.position() - position - 4); bytes.write(byteBuffer); }
@Override public void write(Bytes bytes, Map<String, String> kvMap) { if (kvMap == null) { bytes.writeStopBit(NULL_SIZE); return; } bytes.writeStopBit(kvMap.size()); long position = bytes.position(); bytes.clear(); bytes.position(position + 4); DataOutputStream dos = new DataOutputStream( new DeflaterOutputStream(bytes.outputStream(), new Deflater(level))); try { for (Map.Entry<String, String> entry : kvMap.entrySet()) { dos.writeUTF(entry.getKey()); dos.writeUTF(entry.getValue()); } dos.close(); } catch (IOException e) { throw new IllegalStateException(e); } bytes.writeUnsignedInt(position, bytes.position() - position - 4); }
@Override public void write(Bytes bytes, Map<String, String> kvMap) { if (kvMap == null) { bytes.writeStopBit(NULL_SIZE); return; } bytes.writeStopBit(kvMap.size()); long position = bytes.position(); bytes.clear(); bytes.position(position + 4); DataOutputStream dos = new DataOutputStream( new DeflaterOutputStream(bytes.outputStream(), new Deflater(level))); try { for (Map.Entry<String, String> entry : kvMap.entrySet()) { dos.writeUTF(entry.getKey()); dos.writeUTF(entry.getValue()); } dos.close(); } catch (IOException e) { throw new IllegalStateException(e); } bytes.writeUnsignedInt(position, bytes.position() - position - 4); }