public class NOnesIntDecoder extends FourFlagsIntDecoder
NOnesIntEncoder
. Uses a
FourFlagsIntDecoder
to perform the actual encoding and translates the
values back as described in NOnesIntEncoder
.NOnesIntEncoder
EOS, in
Constructor and Description |
---|
NOnesIntDecoder(int n)
Constructs a decoder with a given N (Number of consecutive '1's which are
translated into a single target value '2'.
|
Modifier and Type | Method and Description |
---|---|
long |
decode()
Decodes data received from the input stream, and returns one decoded
integer.
|
void |
reInit(InputStream in)
Sets the input stream from which the encoded data is read.
|
String |
toString() |
public NOnesIntDecoder(int n)
public long decode() throws IOException
IntDecoder
IntDecoder.EOS
is returned.decode
in class FourFlagsIntDecoder
IntDecoder.EOS
if end-of-stream
reached.IOException
- if an I/O error occurspublic void reInit(InputStream in)
IntDecoder
reInit
in class FourFlagsIntDecoder
public String toString()
toString
in class FourFlagsIntDecoder