java.lang.Object
ClassLib.Common.java.util.zip.StreamManipulator
- class StreamManipulator
- extends java.lang.Object
StreamManipulator
- Version:
- $Id: StreamManipulator.java,v 1.4 2003/05/12 10:04:53 joewhaley Exp $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
window
private byte[] window
window_start
private int window_start
window_end
private int window_end
buffer
private int buffer
bits_in_buffer
private int bits_in_buffer
StreamManipulator
public StreamManipulator()
peekBits
public final int peekBits(int n)
- Get the next n bits but don't increase input pointer. n must be
less or equal 16 and if you if this call succeeds, you must drop
at least n-8 bits in the next call.
dropBits
public final void dropBits(int n)
getBits
public final int getBits(int n)
- Gets the next n bits and increases input pointer. This is equivalent
to peekBits followed by dropBits, except for correct error handling.
getAvailableBits
public final int getAvailableBits()
- Gets the number of bits available in the bit buffer. This must be
only called when a previous peekBits() returned -1.
getAvailableBytes
public final int getAvailableBytes()
- Gets the number of bytes available.
skipToByteBoundary
public void skipToByteBoundary()
- Skips to the next byte boundary.
needsInput
public final boolean needsInput()
copyBytes
public int copyBytes(byte[] output,
int offset,
int length)
reset
public void reset()
setInput
public void setInput(byte[] buf,
int off,
int len)