@Override public void readMarshallable(BytesIn bytes) throws IORuntimeException { ts = bytes.readLong(); bytes.read(filler); }
@Override protected void setValue(Object o, @NotNull BytesIn read) throws IllegalAccessException { field.setLong(o, read.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()); }
@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()); } }
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) throws IORuntimeException { long position = bytes.readPosition(); long capacity = bytes.readLong(); long used = bytes.readLong(); if (capacity < 0 || capacity > bytes.readRemaining() >> 3) throw new IORuntimeException("Corrupt used capacity"); if (used < 0 || used > capacity) throw new IORuntimeException("Corrupt used value"); bytes.readSkip(capacity * 8); long length = bytes.readPosition() - position; bytesStore(((Bytes) bytes).bytesStore(), position, length); }