Package org.scijava.io.nio
Class ByteBufferByteBank
- java.lang.Object
-
- org.scijava.io.nio.ByteBufferByteBank
-
-
Constructor Summary
Constructors Constructor Description ByteBufferByteBank()ByteBufferByteBank(int initialCapacity)ByteBufferByteBank(Function<Integer,ByteBuffer> provider)ByteBufferByteBank(Function<Integer,ByteBuffer> provider, int initialCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the bufferbytegetByte(long pos)intgetBytes(long startPos, byte[] b, int offset, int length)longgetMaxBufferSize()booleanisReadOnly()voidsetByte(long pos, byte b)Sets the byte at the given positionvoidsetBytes(long startpos, byte[] bytes, int offset, int length)Sets the bytes starting form the given position to the values form the provided array.longsize()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.scijava.io.ByteBank
appendBytes, appendBytes, basicRangeCheck, checkReadPos, checkWritePos, getBytes, toByteArray, toByteArray
-
-
-
-
Constructor Detail
-
ByteBufferByteBank
public ByteBufferByteBank()
-
ByteBufferByteBank
public ByteBufferByteBank(Function<Integer,ByteBuffer> provider)
-
ByteBufferByteBank
public ByteBufferByteBank(Function<Integer,ByteBuffer> provider, int initialCapacity)
-
ByteBufferByteBank
public ByteBufferByteBank(int initialCapacity)
-
-
Method Detail
-
getMaxBufferSize
public long getMaxBufferSize()
- Specified by:
getMaxBufferSizein interfaceByteBank- Returns:
- the maximal size of the buffer
-
setBytes
public void setBytes(long startpos, byte[] bytes, int offset, int length)Description copied from interface:ByteBankSets the bytes starting form the given position to the values form the provided array.
-
setByte
public void setByte(long pos, byte b)Description copied from interface:ByteBankSets the byte at the given position
-
clear
public void clear()
Description copied from interface:ByteBankClears the buffer
-
getByte
public byte getByte(long pos)
-
getBytes
public int getBytes(long startPos, byte[] b, int offset, int length)
-
size
public long size()
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfaceByteBank- Returns:
- True iff the buffer is read-only.
-
-