@Test public void testFacarde() { IFacade f = Values.newNativeReference(IFacade.class); Byteable byteable = (Byteable) f; long capacity = byteable.maxSize(); byteable.bytesStore(NativeBytesStore.nativeStore(capacity), 0, capacity); System.out.println(f); }
@Override public void init(JLBH jlbh) { IOTools.deleteDirWithFiles("replica", 10); Byteable byteable = (Byteable) datum; long capacity = byteable.maxSize(); byteable.bytesStore(NativeBytesStore.nativeStore(capacity), 0, capacity); datumBytes = ((Byteable) datum).bytesStore(); datumWrite = datumBytes.bytesForWrite(); sourceQueue = single("replica").build(); sinkQueue = single("replica").build(); appender = sourceQueue.acquireAppender(); tailer = sinkQueue.createTailer(); this.jlbh = jlbh; }
@org.jetbrains.annotations.NotNull public static BytesStore subBytes(RandomDataInput from, long start, long length) throws BufferUnderflowException { try { @org.jetbrains.annotations.NotNull BytesStore ret = NativeBytesStore.nativeStore(Math.max(0, length)); ret.write(0L, from, start, length); return ret; } catch (IllegalArgumentException | BufferOverflowException e) { throw new AssertionError(e); } }
@NotNull public static NativeBytesStore from(@NotNull byte[] bytes) { try { @NotNull NativeBytesStore nbs = nativeStore(bytes.length); Bytes.wrapForRead(bytes).copyTo(nbs); return nbs; } catch (IllegalArgumentException e) { throw new AssertionError(e); } }
inBytes = this; } else { inBytes = NativeBytesStore.nativeStore(size); this.copyTo(inBytes);