public void readMarshallable(BytesIn bytes) { age = bytes.readInt(); name.setLength(0); bytes.readUtf8(name); }
public void readMarshallable(BytesIn bytes) { age = bytes.readInt(); name.setLength(0); bytes.readUtf8(name); }
@Override protected void setValue(Object o, @NotNull BytesIn read) throws IllegalAccessException { field.setInt(o, read.readInt()); } }
default <T> T readObject(Class<T> componentType) { if (BytesMarshallable.class.isAssignableFrom(componentType)) { BytesMarshallable bm = (BytesMarshallable) ObjectUtils.newInstance(componentType); bm.readMarshallable(this); return (T) bm; } if (Enum.class.isAssignableFrom(componentType)) { return (T) readEnum((Class) componentType); } switch (componentType.getName()) { case "java.lang.String": return (T) readUtf8(); case "java.lang.Double": return (T) (Double) readDouble(); case "java.lang.Long": return (T) (Long) readLong(); case "java.lang.Integer": return (T) (Integer) readInt(); default: throw new UnsupportedOperationException("Unsupported " + componentType); } } }
@Override public void readMarshallable(BytesIn bytes) { bs.writeInt(offset + 0, ((bs.readInt(offset + 0)) & 0xFF000000) | (bytes.readInt())); bs.writeLong(offset + 3, ((bs.readLong(offset + 3)) & 0xFFFFFF0000000000L) | (bytes.readLong())); bs.writeLong(offset + 8, ((bs.readLong(offset + 8)) & 0xFFFFFF0000000000L) | (bytes.readLong())); bs.writeInt(offset + 13, (int) (bytes.readLong())); bs.writeLong(offset + 17, bytes.readLong()); bs.writeInt(offset + 25, bytes.readInt()); bs.writeByte(offset + 29, (byte) (bytes.readInt())); for (int index = 0; index < 128; index++) { setModificationIteratorInitAt(index, bytes.readBoolean()); } }
do { hasNext = offsetTailer.readBytes(b -> { int queue = b.readInt(); long off = b.readLong();
@Override public void readMarshallable(BytesIn bytes) { bs.writeInt(offset + 0, ((bs.readInt(offset + 0)) & 0xFF000000) | (bytes.readInt())); bs.writeLong(offset + 3, ((bs.readLong(offset + 3)) & 0xFFFFFF0000000000L) | (bytes.readLong())); bs.writeLong(offset + 8, ((bs.readLong(offset + 8)) & 0xFFFFFF0000000000L) | (bytes.readLong())); bs.writeInt(offset + 13, (int) (bytes.readLong())); bs.writeLong(offset + 17, bytes.readLong()); }