public class KissEscapeOutputStream
extends java.io.OutputStream
Modifier and Type | Class and Description |
---|---|
static class |
KissEscapeOutputStream.RcvState
States of a KISS frame decoder.
|
Modifier and Type | Field and Description |
---|---|
static int |
FEND
Byte value for end-of-frame flag byte in KISS protocol.
|
static int |
FESC
Byte value of prefix for escaped byte value (use of protocol byte value in frame body).
|
static int |
TFEND
Escaped value for literal FEND character.
|
static int |
TFESC
Escaped value for literal FESC character.
|
Constructor and Description |
---|
KissEscapeOutputStream(java.io.DataOutput out)
Create a KissEscapeOutputStream wrapped around an implementation of the java.io.DataOutput
interface.
|
KissEscapeOutputStream(java.io.DataOutput out,
boolean escCForKenwood)
Create a KissEscapeOutputStream wrapped around an implementation of the java.io.DataOutput
interface.
|
KissEscapeOutputStream(java.io.OutputStream os)
Create a KissEscapeOutputStream wrapped around an OutputStream.
|
KissEscapeOutputStream(java.io.OutputStream os,
boolean escCForKenwood)
Create a KissEscapeOutputStream wrapped around an OutputStream.
|
Modifier and Type | Method and Description |
---|---|
int |
getByteCount()
Get the number of bytes passed through this stream (counting escape codes injected by the stream).
|
byte |
getG8bpqCrc()
Get the G8BPQ CRC value for the last sent KISS frame.
|
void |
resetByteCount()
Reset the statistics fields for this stream.
|
void |
write(int b)
Write one byte to the output stream.
|
public static final int FEND
public static final int FESC
public static final int TFEND
public static final int TFESC
public KissEscapeOutputStream(java.io.DataOutput out)
out
- DataOutput interface implementer to wrap with this streampublic KissEscapeOutputStream(java.io.OutputStream os)
os
- OutputStream to receive KISS-encoded framespublic KissEscapeOutputStream(java.io.DataOutput out, boolean escCForKenwood)
out
- DataOutput interface implementer to wrap with this streamescCForKenwood
- boolean, if true also escape 'C' with FESC to protect against Kenwood "features"public KissEscapeOutputStream(java.io.OutputStream os, boolean escCForKenwood)
os
- OutputStream to receive KISS-encoded framesescCForKenwood
- boolean, if true also escape 'C' with FESC to protect against Kenwood "features"public int getByteCount()
public void resetByteCount()
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- byte value to encodejava.io.IOException
- if wrapped stream throws an IOExceptionpublic byte getG8bpqCrc()