|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
com.voytechs.jnetstream.io.ProtocolDataOutputStream
public class ProtocolDataOutputStream
Writes native JAVA types into the stream. Also allows bit by bit writes with several methods that extend the default OutpuStream methods.
| Field Summary | |
|---|---|
protected int |
bitsLeft
|
protected int |
cachedByte
|
protected java.io.OutputStream |
out
|
| Constructor Summary | |
|---|---|
protected |
ProtocolDataOutputStream()
A empty constructor that can only be called on by sub-classes. |
|
ProtocolDataOutputStream(java.io.OutputStream out)
|
| Method Summary | |
|---|---|
void |
flush()
Flushes all unwritten data, including bit by bit data. |
static void |
main(java.lang.String[] args)
Test function for ProtocolDataOutputStream |
void |
unloadCachedByte()
Writes (unloads) the cached by to output stream. |
void |
write(byte[] b)
Write an array of bytes to the stream starting at current bit and byte positions. |
void |
write(int b)
Write a single byte to the stream starting at current bit and byte positions. |
void |
write(int b,
int bits)
Writes any number of bits into the stream. |
void |
write(long b,
int bits)
Writes any number of bits into the stream. |
void |
writeByte(byte v)
Writes out a signed byte to the output stream. |
void |
writeInt(int v)
Writes out a signed int to the output stream. |
void |
writeL(int b,
int bits)
Writes any number of bits into the stream. |
void |
writeLByte(byte v)
Writes out a signed byte to the output stream. |
void |
writeLInt(int v)
Writes out a signed int to the output stream. |
void |
writeLLong(long v)
Writes out a signed long to the output stream. |
void |
writeLong(long v)
Writes out a signed long to the output stream. |
void |
writeLShort(int v)
Writes out a signed short to the output stream. |
void |
writeShort(int v)
Writes out a signed short to the output stream. |
void |
writeUByte(byte v)
Writes out a unsigned byte to the output stream. |
void |
writeUInt(int v)
Writes out a unsigned int to the output stream. |
void |
writeULByte(byte v)
Writes out a unsigned byte to the output stream. |
void |
writeULInt(int v)
Writes out a unsigned int to the output stream. |
void |
writeULLong(long v)
Writes out a unsigned long to the output stream. |
void |
writeULong(long v)
Writes out a signed long to the output stream. |
void |
writeULShort(int v)
Writes out a unsigned int to the output stream. |
void |
writeUShort(int v)
Writes out a unsigned short to the output stream. |
| Methods inherited from class java.io.OutputStream |
|---|
close, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.OutputStream out
protected int bitsLeft
protected int cachedByte
| Constructor Detail |
|---|
protected ProtocolDataOutputStream()
public ProtocolDataOutputStream(java.io.OutputStream out)
out - OutputStream to write to.
| Method Detail |
|---|
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamb - Byte to write to the stream.
java.io.IOException - Any IO errors
public void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamb - Byte array to write to the stream.
java.io.IOException - Any IO errors
public void write(int b,
int bits)
throws java.io.IOException
b - Interger variable to write to the stream.bits - Number of bits to write from "b", pivoting at the least significan bit
java.io.IOException
public void write(long b,
int bits)
throws java.io.IOException
b - Interger variable to write to the stream.bits - Number of bits to write from "b", pivoting at the least significan bit
java.io.IOException
public void writeL(int b,
int bits)
throws java.io.IOException
b - Interger variable to write to the stream.bits - Number of bits to write from "b", pivoting at the least significan bit
java.io.IOException
public void unloadCachedByte()
throws java.io.IOException
java.io.IOException
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException
public void writeByte(byte v)
throws java.io.IOException
v - Byte to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeShort(int v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeInt(int v)
throws java.io.IOException
v - Int to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeLong(long v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeUByte(byte v)
throws java.io.IOException
v - Byte to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeUInt(int v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeUShort(int v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeULong(long v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeLByte(byte v)
throws java.io.IOException
v - Byte to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeLShort(int v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeLInt(int v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeLLong(long v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeULByte(byte v)
throws java.io.IOException
v - Byte to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeULShort(int v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeULInt(int v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.
public void writeULLong(long v)
throws java.io.IOException
v - Short to value to be written.
java.io.IOException - if an I/O error occurs.public static void main(java.lang.String[] args)
args - command line arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||