Package com.tangosol.io
Class DebugDataOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- com.tangosol.io.DebugDataOutputStream
-
- All Implemented Interfaces:
com.oracle.coherence.common.io.OutputStreaming,OutputStreaming,Closeable,DataOutput,Flushable,AutoCloseable
public class DebugDataOutputStream extends FilterOutputStream implements DataOutput, OutputStreaming
This is an imitation DataOutputStream class that logs the output in a human-readable format for debugging purposes. All output will be- Author:
- cp 2004.08.06
-
-
Field Summary
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description DebugDataOutputStream(OutputStream stream)Construct a DebugDataOutputStream that will output to the specified Stream object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this OutputStream and releases any associated system resources.voidflush()Flushes this OutputStream and forces any buffered output bytes to be written.static voidmain(String[] asArg)Command line test.protected voidprintln(String s)Print the passed String to the underlying stream.voidwrite(byte[] ab)Writes all the bytes in the arrayab.voidwrite(byte[] ab, int of, int cb)Writescbbytes starting at offsetoffrom the arrayab.voidwrite(int b)Writes the eight low-order bits of the argumentb.voidwriteBoolean(boolean f)Writes the boolean valuef.voidwriteByte(int b)Writes the eight low-order bits of the argumentb.voidwriteBytes(String s)Writes the Strings, but only the low-order byte from each character of the String is written.voidwriteChar(int ch)Writes a char value, comprised of the 16 low-order bits of the argumentch; the 16 high-order bits ofchare ignored.voidwriteChars(String s)Writes the Stringsas a sequence of characters.voidwriteDouble(double dfl)Writes a double value.voidwriteFloat(float fl)Writes a float value.voidwriteInt(int n)Writes an int value.voidwriteLong(long l)Writes a long value.voidwriteShort(int n)Writes a short value, comprised of the 16 low-order bits of the argumentn; the 16 high-order bits ofnare ignored.voidwriteUTF(String s)Writes the Stringsas a sequence of characters, but using UTF-8 encoding for the characters, and including the String length data so that the correspondingDataInput.readUTF()method can reconstitute a String from the written data.-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
DebugDataOutputStream
public DebugDataOutputStream(OutputStream stream)
Construct a DebugDataOutputStream that will output to the specified Stream object.- Parameters:
stream- an OutputStream to write to
-
-
Method Detail
-
write
public void write(int b) throws IOExceptionWrites the eight low-order bits of the argumentb. The 24 high-order bits ofbare ignored.- Specified by:
writein interfaceDataOutput- Specified by:
writein interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
writein classFilterOutputStream- Parameters:
b- the byte to write (passed as an integer)- Throws:
IOException- if an I/O error occurs
-
write
public void write(byte[] ab) throws IOExceptionWrites all the bytes in the arrayab.- Specified by:
writein interfaceDataOutput- Specified by:
writein interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
writein classFilterOutputStream- Parameters:
ab- the byte array to write- Throws:
IOException- if an I/O error occursNullPointerException- ifabisnull
-
write
public void write(byte[] ab, int of, int cb) throws IOExceptionWritescbbytes starting at offsetoffrom the arrayab.- Specified by:
writein interfaceDataOutput- Specified by:
writein interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
writein classFilterOutputStream- Parameters:
ab- the byte array to write fromof- the offset intoabto start writing fromcb- the number of bytes fromabto write- Throws:
IOException- if an I/O error occursNullPointerException- ifabisnullIndexOutOfBoundsException- ifofis negative, orcbis negative, orof+cbis greater thanab.length
-
writeBoolean
public void writeBoolean(boolean f) throws IOExceptionWrites the boolean valuef.- Specified by:
writeBooleanin interfaceDataOutput- Parameters:
f- the boolean to be written- Throws:
IOException- if an I/O error occurs
-
writeByte
public void writeByte(int b) throws IOExceptionWrites the eight low-order bits of the argumentb. The 24 high-order bits ofbare ignored.- Specified by:
writeBytein interfaceDataOutput- Parameters:
b- the byte to write (passed as an integer)- Throws:
IOException- if an I/O error occurs
-
writeShort
public void writeShort(int n) throws IOExceptionWrites a short value, comprised of the 16 low-order bits of the argumentn; the 16 high-order bits ofnare ignored.- Specified by:
writeShortin interfaceDataOutput- Parameters:
n- the short to write (passed as an integer)- Throws:
IOException- if an I/O error occurs
-
writeChar
public void writeChar(int ch) throws IOExceptionWrites a char value, comprised of the 16 low-order bits of the argumentch; the 16 high-order bits ofchare ignored.- Specified by:
writeCharin interfaceDataOutput- Parameters:
ch- the char to write (passed as an integer)- Throws:
IOException- if an I/O error occurs
-
writeInt
public void writeInt(int n) throws IOExceptionWrites an int value.- Specified by:
writeIntin interfaceDataOutput- Parameters:
n- the int to write- Throws:
IOException- if an I/O error occurs
-
writeLong
public void writeLong(long l) throws IOExceptionWrites a long value.- Specified by:
writeLongin interfaceDataOutput- Parameters:
l- the long to write- Throws:
IOException- if an I/O error occurs
-
writeFloat
public void writeFloat(float fl) throws IOExceptionWrites a float value.- Specified by:
writeFloatin interfaceDataOutput- Parameters:
fl- the float to write- Throws:
IOException- if an I/O error occurs
-
writeDouble
public void writeDouble(double dfl) throws IOExceptionWrites a double value.- Specified by:
writeDoublein interfaceDataOutput- Parameters:
dfl- the double to write- Throws:
IOException- if an I/O error occurs
-
writeBytes
public void writeBytes(String s) throws IOException
Writes the Strings, but only the low-order byte from each character of the String is written.- Specified by:
writeBytesin interfaceDataOutput- Parameters:
s- the String to write- Throws:
IOException- if an I/O error occursNullPointerException- ifsisnull
-
writeChars
public void writeChars(String s) throws IOException
Writes the Stringsas a sequence of characters.- Specified by:
writeCharsin interfaceDataOutput- Parameters:
s- the String to write- Throws:
IOException- if an I/O error occursNullPointerException- ifsisnull
-
writeUTF
public void writeUTF(String s) throws IOException
Writes the Stringsas a sequence of characters, but using UTF-8 encoding for the characters, and including the String length data so that the correspondingDataInput.readUTF()method can reconstitute a String from the written data.- Specified by:
writeUTFin interfaceDataOutput- Parameters:
s- the String to write- Throws:
IOException- if an I/O error occursNullPointerException- ifsisnull
-
flush
public void flush() throws IOExceptionFlushes this OutputStream and forces any buffered output bytes to be written.- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
flushin classFilterOutputStream- Throws:
IOException- if an I/O error occurs
-
close
public void close() throws IOExceptionCloses this OutputStream and releases any associated system resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfacecom.oracle.coherence.common.io.OutputStreaming- Overrides:
closein classFilterOutputStream- Throws:
IOException- if an I/O error occurs
-
println
protected void println(String s) throws IOException
Print the passed String to the underlying stream.- Parameters:
s- the String to print- Throws:
IOException
-
-