public class ByteBufferWrapper extends BufferWrapper
NOTE: We no longer need to support JDK 1.3 as of the Java 3D 1.3.2 community source release on java.net. We should be able to get rid of this class.
TYPE_BYTE, TYPE_DOUBLE, TYPE_FLOAT, TYPE_NULL, TYPE_UNKNOWN
Constructor and Description |
---|
ByteBufferWrapper(ByteBuffer buffer)
Constructor initializes buffer with a
java.nio.ByteBuffer object.
|
ByteBufferWrapper(J3DBuffer b)
Constructor initializes buffer with a
org.scijava.java3d.J3DBuffer object.
|
Modifier and Type | Method and Description |
---|---|
static ByteBufferWrapper |
allocateDirect(int capacity)
Allocate a direct ByteBuffer with the given capacity.
|
DoubleBufferWrapper |
asDoubleBuffer()
Creates a view of this ByteBufferWrapper as a
DoubleBufferWrapper.
|
FloatBufferWrapper |
asFloatBuffer()
Creates a view of this ByteBufferWrapper as a
FloatBufferWrapper.
|
byte |
get()
Reads the byte at this buffer's current position,
and then increments the position.
|
ByteBufferWrapper |
get(byte[] dst)
Bulk get method.
|
ByteBufferWrapper |
get(byte[] dst,
int offset,
int length)
Bulk get method.
|
byte |
get(int index)
Reads the byte at the given offset into the buffer.
|
Buffer |
getBuffer()
Returns the java.nio.Buffer contained within this
ByteBufferWrapper.
|
J3DBuffer |
getJ3DBuffer()
Creates and returns a J3DBuffer object containing the
buffer in this ByteBufferWrapper object.
|
boolean |
isDirect() |
ByteOrder |
order()
Returns the byte order of this buffer.
|
ByteBufferWrapper |
order(ByteOrder bo)
Modifies this buffer's byte order.
|
ByteBufferWrapper |
put(byte[] src)
Bulk put method.
|
capacity, getBufferAsObject, getBufferType, limit, position, position, rewind
public ByteBufferWrapper(ByteBuffer buffer)
public ByteBufferWrapper(J3DBuffer b)
public static ByteBufferWrapper allocateDirect(int capacity)
public Buffer getBuffer()
public boolean isDirect()
public byte get()
public byte get(int index)
public ByteBufferWrapper get(byte[] dst)
dst.length
bytes from
the buffer to the destination array and increments the
buffer's position by dst.length
.public ByteBufferWrapper get(byte[] dst, int offset, int length)
public ByteOrder order()
public ByteBufferWrapper order(ByteOrder bo)
public FloatBufferWrapper asFloatBuffer()
public DoubleBufferWrapper asDoubleBuffer()
public ByteBufferWrapper put(byte[] src)
src.length
bytes into the buffer at the current position.public J3DBuffer getJ3DBuffer()
Copyright © 2016–2022 SciJava. All rights reserved.