@Override @SneakyThrows(IOException.class) public ByteBuffer toBytes() { ByteArraySegment serialized = SERIALIZER.serialize(this); return ByteBuffer.wrap(serialized.array(), serialized.arrayOffset(), serialized.getLength()); }
@Override @SneakyThrows(IOException.class) public ByteBuffer toBytes() { ByteArraySegment serialized = SERIALIZER.serialize(this); return ByteBuffer.wrap(serialized.array(), serialized.arrayOffset(), serialized.getLength()); }
@SneakyThrows(IOException.class) public ByteBuffer toBytes() { ByteArraySegment serialized = SERIALIZER.serialize(this); return ByteBuffer.wrap(serialized.array(), serialized.arrayOffset(), serialized.getLength()); }
@Override @SneakyThrows(IOException.class) public ByteBuffer toBytes() { ByteArraySegment serialized = SERIALIZER.serialize(this); return ByteBuffer.wrap(serialized.array(), serialized.arrayOffset(), serialized.getLength()); }
@Override @SneakyThrows(IOException.class) public ByteBuffer serialize(Update<ReaderGroupState> value) { ByteArraySegment serialized = serializer.serialize(value); return ByteBuffer.wrap(serialized.array(), serialized.arrayOffset(), serialized.getLength()); }
@SneakyThrows(IOException.class) public ByteBuffer toBytes() { ByteArraySegment serialized = SERIALIZER.serialize(this); return ByteBuffer.wrap(serialized.array(), serialized.arrayOffset(), serialized.getLength()); }
@Override @SneakyThrows(IOException.class) public ByteBuffer toBytes() { ByteArraySegment serialized = SERIALIZER.serialize(this); return ByteBuffer.wrap(serialized.array(), serialized.arrayOffset(), serialized.getLength()); }
/** * Compares two non-null ByteArraySegments of the same length using lexicographic bitwise comparison. * * @param b1 First instance. * @param b2 Second instance. * @return -1 if b1 should be before b2, 0 if b1 equals b2 and 1 if b1 should be after b2. */ int compare(ByteArraySegment b1, ByteArraySegment b2) { assert b1.getLength() == b2.getLength(); return compare(b1.array(), b1.arrayOffset(), b2.array(), b2.arrayOffset(), b1.getLength()); }
@Override @SneakyThrows(IOException.class) public ByteBuffer toBytes() { ByteArraySegment serialized = SERIALIZER.serialize(this); return ByteBuffer.wrap(serialized.array(), serialized.arrayOffset(), serialized.getLength()); }
@Override @SneakyThrows(IOException.class) public ByteBuffer serialize(InitialUpdate<ReaderGroupState> value) { ByteArraySegment serialized = serializer.serialize(value); return ByteBuffer.wrap(serialized.array(), serialized.arrayOffset(), serialized.getLength()); }
/** * Serializes the given byte array segment. Equivalent to calling writeArray(segment, segment.arrayOffset(), segment.getLength()). * * @param segment The byte array segment to serialize. Can be null (in which case an Empty array will be deserialized * by RevisionDataInput.readArray()). * @throws IOException If an IO Exception occurred. */ default void writeArray(ByteArraySegment segment) throws IOException { if (segment == null) { writeArray(null, 0, 0); } else { writeArray(segment.array(), segment.arrayOffset(), segment.getLength()); } }
private void write00(T o, RevisionDataOutput target) throws IOException { ByteArraySegment c = o.getContents(); target.length(Long.BYTES + target.getCompactIntLength(c.getLength()) + c.getLength()); target.writeLong(o.getSequenceNumber()); target.writeArray(c.array(), c.arrayOffset(), c.getLength()); }