protected ByteBuffer readByteBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length); value.put(content, index, length).rewind(); index += length; return value; }else{ ByteBuffer value = BufferUtils.createByteBuffer(length); for (int x = 0; x < length; x++) { value.put(readByteForBuffer(content)); } value.rewind(); return value; } }
protected ByteBuffer readByteBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length); value.put(content, index, length).rewind(); index += length; return value; }else{ ByteBuffer value = BufferUtils.createByteBuffer(length); for (int x = 0; x < length; x++) { value.put(readByteForBuffer(content)); } value.rewind(); return value; } }
protected ByteBuffer readByteBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length); value.put(content, index, length).rewind(); index += length; return value; }else{ ByteBuffer value = BufferUtils.createByteBuffer(length); for (int x = 0; x < length; x++) { value.put(readByteForBuffer(content)); } value.rewind(); return value; } }