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 ShortBuffer readShortBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length * 2); value.put(content, index, length * 2).rewind(); index += length * 2; return value.asShortBuffer(); }else{ ShortBuffer value = BufferUtils.createShortBuffer(length); for (int x = 0; x < length; x++) { value.put(readShortForBuffer(content)); } value.rewind(); return value; } }
protected FloatBuffer readFloatBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length * 4); value.put(content, index, length * 4).rewind(); index += length * 4; return value.asFloatBuffer(); }else{ FloatBuffer value = BufferUtils.createFloatBuffer(length); for (int x = 0; x < length; x++) { value.put(readFloatForBuffer(content)); } value.rewind(); return value; } }
protected IntBuffer readIntBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length * 4); value.put(content, index, length * 4).rewind(); index += length * 4; return value.asIntBuffer(); }else{ IntBuffer value = BufferUtils.createIntBuffer(length); for (int x = 0; x < length; x++) { value.put(readIntForBuffer(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; } }
protected ShortBuffer readShortBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length * 2); value.put(content, index, length * 2).rewind(); index += length * 2; return value.asShortBuffer(); }else{ ShortBuffer value = BufferUtils.createShortBuffer(length); for (int x = 0; x < length; x++) { value.put(readShortForBuffer(content)); } value.rewind(); return value; } }
protected IntBuffer readIntBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length * 4); value.put(content, index, length * 4).rewind(); index += length * 4; return value.asIntBuffer(); }else{ IntBuffer value = BufferUtils.createIntBuffer(length); for (int x = 0; x < length; x++) { value.put(readIntForBuffer(content)); } value.rewind(); return value; } }
protected IntBuffer readIntBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length * 4); value.put(content, index, length * 4).rewind(); index += length * 4; return value.asIntBuffer(); }else{ IntBuffer value = BufferUtils.createIntBuffer(length); for (int x = 0; x < length; x++) { value.put(readIntForBuffer(content)); } value.rewind(); return value; } }
protected FloatBuffer readFloatBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length * 4); value.put(content, index, length * 4).rewind(); index += length * 4; return value.asFloatBuffer(); }else{ FloatBuffer value = BufferUtils.createFloatBuffer(length); for (int x = 0; x < length; x++) { value.put(readFloatForBuffer(content)); } value.rewind(); return value; } }
protected FloatBuffer readFloatBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length * 4); value.put(content, index, length * 4).rewind(); index += length * 4; return value.asFloatBuffer(); }else{ FloatBuffer value = BufferUtils.createFloatBuffer(length); for (int x = 0; x < length; x++) { value.put(readFloatForBuffer(content)); } value.rewind(); return value; } }
protected ShortBuffer readShortBuffer(byte[] content) throws IOException { int length = readInt(content); if (length == BinaryOutputCapsule.NULL_OBJECT) return null; if (BinaryImporter.canUseFastBuffers()){ ByteBuffer value = BufferUtils.createByteBuffer(length * 2); value.put(content, index, length * 2).rewind(); index += length * 2; return value.asShortBuffer(); }else{ ShortBuffer value = BufferUtils.createShortBuffer(length); for (int x = 0; x < length; x++) { value.put(readShortForBuffer(content)); } value.rewind(); return value; } }