public class MemByteBuffer extends Object implements BitOut, BitIn
ByteBuffer
.
Supports gamma and unary encoding of strictly positive integers.USUAL_EXTENSION
Constructor and Description |
---|
MemByteBuffer()
Constructor (1 byte).
|
MemByteBuffer(MemByteBuffer copy)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
align()
Not Implemented.
|
void |
close()
Not Implemented.
|
byte |
getBitOffset()
Not Implemented.
|
long |
getByteOffset()
Not Implemented.
|
int |
readBinary(int len)
Not Implemented.
|
int |
readDelta()
Not Implemented.
|
int |
readGamma()
Gamma decoding.
|
int |
readGolomb(int b)
Not Implemented.
|
void |
readInterpolativeCoding(int[] data,
int offset,
int len,
int lo,
int hi)
Not Implemented.
|
int |
readMinimalBinary(int b)
Not Implemented.
|
int |
readMinimalBinaryZero(int b)
Not Implemented.
|
int |
readSkewedGolomb(int b)
Not Implemented.
|
int |
readUnary()
Unary decoding.
|
void |
skipBits(int len)
Not Implemented.
|
void |
skipBytes(long len)
Not Implemented.
|
int |
writeBinary(int len,
int x)
Not Implemented.
|
int |
writeDelta(int x)
Not Implemented.
|
int |
writeGamma(int n)
Gamma encoding.
|
int |
writeGolomb(int x,
int b)
Not Implemented.
|
int |
writeInt(int x,
int len)
Not Implemented.
|
int |
writeInterpolativeCode(int[] data,
int offset,
int len,
int lo,
int hi)
Not Implemented.
|
int |
writeMinimalBinary(int x,
int b)
Not Implemented.
|
int |
writeSkewedGolomb(int x,
int b)
Not Implemented.
|
int |
writeUnary(int n)
Unary encoding.
|
public MemByteBuffer()
public MemByteBuffer(MemByteBuffer copy)
public int writeUnary(int n)
writeUnary
in interface BitOut
n
- the number to writepublic int writeGamma(int n)
writeGamma
in interface BitOut
n
- the int number to writepublic int readUnary()
public int readGamma()
public int readBinary(int len) throws IOException
readBinary
in interface BitIn
len
- the number of binary bits to readIOException
- if an I/O error occurspublic int readMinimalBinary(int b) throws IOException
readMinimalBinary
in interface BitIn
b
- the upper boundIOException
- if an I/O error occurspublic int readMinimalBinaryZero(int b) throws IOException
readMinimalBinaryZero
in interface BitIn
b
- the upper boundIOException
- if an I/O error occurspublic int readGolomb(int b) throws IOException
readGolomb
in interface BitIn
b
- the golomb modulusIOException
- if and I/O error occurspublic int readSkewedGolomb(int b) throws IOException
readSkewedGolomb
in interface BitIn
IOException
- if an I/O error occurspublic int readDelta() throws IOException
readDelta
in interface BitIn
IOException
- if an I/O error occurspublic void readInterpolativeCoding(int[] data, int offset, int len, int lo, int hi) throws IOException
readInterpolativeCoding
in interface BitIn
data
- the result vectoroffset
- offset where to write in the vectorlen
- the number of integers to decode.lo
- a lower bound (the same one passed to writeInterpolativeCoding)hi
- an upper bound (the same one passed to writeInterpolativeCoding)IOException
- if an I/O error occurspublic void skipBits(int len) throws IOException
skipBits
in interface BitIn
len
- The number of bits to skipIOException
- if an I/O error occurspublic void skipBytes(long len) throws IOException
skipBytes
in interface BitIn
len
- The number of bytes to skipIOException
- if an I/O error occurspublic void align() throws IOException
align
in interface BitIn
IOException
- if an I/O error occurspublic long getByteOffset()
getByteOffset
in interface BitIn
getByteOffset
in interface BitOut
public byte getBitOffset()
getBitOffset
in interface BitIn
getBitOffset
in interface BitOut
public int writeBinary(int len, int x) throws IOException
writeBinary
in interface BitOut
len
- size in bits of the number.x
- the integer to write.IOException
- if an I/O error occurs.public int writeInterpolativeCode(int[] data, int offset, int len, int lo, int hi) throws IOException
writeInterpolativeCode
in interface BitOut
data
- the vector containing the integer sequence.offset
- the offset into data
where the sequence starts.len
- the number of integers to code.lo
- a lower bound (must be smaller than or equal to the first integer in the sequence).hi
- an upper bound (must be greater than or equal to the last integer in the sequence).IOException
- if an I/O error occurs.public int writeSkewedGolomb(int x, int b) throws IOException
writeSkewedGolomb
in interface BitOut
x
- the number to writeb
- the parameter for golomb codingIOException
- if and I/O error occurspublic int writeGolomb(int x, int b) throws IOException
writeGolomb
in interface BitOut
x
- the number to writeb
- the parameter for golomb codingIOException
- if and I/O error occurspublic int writeMinimalBinary(int x, int b) throws IOException
writeMinimalBinary
in interface BitOut
x
- the number to writeb
- and strict bound for x
IOException
- if an I/O error occurs.public int writeDelta(int x) throws IOException
writeDelta
in interface BitOut
x
- the int number to writeIOException
- if an I/O error occurs.public int writeInt(int x, int len) throws IOException
writeInt
in interface BitOut
x
- the int to writelen
- length of the int in bitsIOException
- if an I/O error occurs.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Terrier 4.0. Copyright © 2004-2014 University of Glasgow