public class BitByteOutputStream extends BitOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected byte |
byteToWrite
A byte to write to the stream.
|
bitOffset, buffer, bufferPointer, bufferSize, byteOffset, DEFAULT_SIZE, dos, logger| Constructor and Description |
|---|
BitByteOutputStream()
Empty constructor, used for subclassing
|
BitByteOutputStream(File file)
Constructs an instance of the class for a given file
|
BitByteOutputStream(OutputStream is)
Constructs an instance of the class for a given stream
|
BitByteOutputStream(String filename)
Constructs an instance of the class for a given filename
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the stream.
|
byte |
getBitOffset()
Returns the bit offset in the last byte.
|
long |
getByteOffset()
Returns the byte offset of the stream.
|
byte |
getByteToWrite() |
void |
pad()
Fills the remaining bits of the current byte with 0s
|
int |
writeInt(int x,
int len)
Writes an integer x into the underlying OutputStream.
|
int |
writeUnary(int x)
Writes an integer x using unary encoding.
|
append, append, flush, padAndFlush, writeBinary, writeDelta, writeGamma, writeGolomb, writeInterpolativeCode, writeMinimalBinary, writeSkewedGolombpublic BitByteOutputStream(OutputStream is) throws IOException
is - java.io.OutputStream the underlying input streamIOException - if an I/O error occurspublic BitByteOutputStream(String filename) throws IOException
filename - java.lang.String the name of the underlying fileIOException - if an I/O error occurspublic BitByteOutputStream(File file) throws IOException
file - java.io.File the underlying fileIOException - if an I/O error occurspublic BitByteOutputStream()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class BitOutputStreamIOException - if an I/O error occurspublic long getByteOffset()
getByteOffset in interface BitOutgetByteOffset in class BitOutputStreampublic byte getBitOffset()
getBitOffset in interface BitOutgetBitOffset in class BitOutputStreampublic int writeUnary(int x)
throws IOException
writeUnary in interface BitOutwriteUnary in class BitOutputStreamx - the number to writeIOException - if an I/O error occurs.public int writeInt(int x,
int len)
throws IOException
writeInt in interface BitOutwriteInt in class BitOutputStreamx - the int to writelen - length of the int in bitsIOException - if an I/O error occurs.public void pad()
throws IOException
IOExceptionpublic byte getByteToWrite()
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow