Package org.scijava.io
Class ByteArrayByteBank
- java.lang.Object
-
- org.scijava.io.ByteArrayByteBank
-
-
Constructor Summary
Constructors Constructor Description ByteArrayByteBank()Creates aByteArrayByteBank.ByteArrayByteBank(byte[] bytes)Creates aByteArrayByteBankthat wraps the provided byte array.ByteArrayByteBank(int initialCapacity)Creates aByteArrayByteBankwith the specified initial capacity.ByteArrayByteBank(ByteArray bytes)Creates aByteArrayByteBankthat wraps the specifiedByteArray.
-
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()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, isReadOnly, toByteArray, toByteArray
-
-
-
-
Constructor Detail
-
ByteArrayByteBank
public ByteArrayByteBank()
Creates aByteArrayByteBank.
-
ByteArrayByteBank
public ByteArrayByteBank(int initialCapacity)
Creates aByteArrayByteBankwith the specified initial capacity.- Parameters:
initialCapacity- the initial capacity of thisByteBank
-
ByteArrayByteBank
public ByteArrayByteBank(byte[] bytes)
Creates aByteArrayByteBankthat wraps the provided byte array.- Parameters:
bytes- the bytes to wrap
-
ByteArrayByteBank
public ByteArrayByteBank(ByteArray bytes)
Creates aByteArrayByteBankthat wraps the specifiedByteArray.- Parameters:
bytes- theByteArrayto wrap
-
-
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)
-
-