|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
com.tangosol.io.WrapperDataOutputStream
public class WrapperDataOutputStream
This is an imitation DataOutputStream class that provides the DataOutput interface by delegating to an object that implements the DataOutput interface. Primarily, this is intended as a base class for building specific-purpose DataOutput wrappers.
Constructor Summary | |
---|---|
WrapperDataOutputStream(DataOutput out)
Construct a WrapperDataOutputStream that will output to the specified object implementing the DataOutput interface. |
Method Summary | |
---|---|
void |
close()
Closes this OutputStream and releases any associated system resources. |
void |
flush()
Flushes this OutputStream and forces any buffered output bytes to be written. |
long |
getBytesWritten()
Return the total number of bytes written to the wrapped DataOutput object. |
DataOutput |
getDataOutput()
Obtain the underlying object providing the DataOutput interface that this object is delegating to. |
protected void |
incBytesWritten(int cb)
Increment the count of total number of bytes written to the wrapped DataOutput object by the specified number of bytes. |
void |
write(byte[] ab)
Writes all the bytes in the array ab . |
void |
write(byte[] ab,
int of,
int cb)
Writes cb bytes starting at offset of from
the array ab . |
void |
write(int b)
Writes the eight low-order bits of the argument b . |
void |
writeBoolean(boolean f)
Writes the boolean value f . |
void |
writeByte(int b)
Writes the eight low-order bits of the argument b . |
void |
writeBytes(String s)
Writes the String s , but only the low-order byte from each
character of the String is written. |
void |
writeChar(int ch)
Writes a char value, comprised of the 16 low-order bits of the argument ch ; the 16 high-order bits of ch are
ignored. |
void |
writeChars(String s)
Writes the String s as a sequence of characters. |
void |
writeDouble(double dfl)
Writes a double value. |
void |
writeFloat(float fl)
Writes a float value. |
void |
writeInt(int n)
Writes an int value. |
void |
writeLong(long l)
Writes a long value. |
void |
writeShort(int n)
Writes a short value, comprised of the 16 low-order bits of the argument n ; the 16 high-order bits of n are
ignored. |
void |
writeUTF(String s)
Writes the String s as a sequence of characters, but using
UTF-8 encoding for the characters, and including the String length data
so that the corresponding DataInput.readUTF() method can
reconstitute a String from the written data. |
Constructor Detail |
---|
public WrapperDataOutputStream(DataOutput out)
out
- an object implementing DataOutput to write toMethod Detail |
---|
public DataOutput getDataOutput()
public long getBytesWritten()
protected void incBytesWritten(int cb)
cb
- the number of bytes to increment the count bypublic void write(int b) throws IOException
b
. The 24
high-order bits of b
are ignored.
write
in interface OutputStreaming
write
in interface DataOutput
write
in class OutputStream
b
- the byte to write (passed as an integer)
IOException
- if an I/O error occurspublic void write(byte[] ab) throws IOException
ab
.
write
in interface OutputStreaming
write
in interface DataOutput
write
in class OutputStream
ab
- the byte array to write
IOException
- if an I/O error occurs
NullPointerException
- if ab
is
null
public void write(byte[] ab, int of, int cb) throws IOException
cb
bytes starting at offset of
from
the array ab
.
write
in interface OutputStreaming
write
in interface DataOutput
write
in class OutputStream
ab
- the byte array to write fromof
- the offset into ab
to start writing fromcb
- the number of bytes from ab
to write
IOException
- if an I/O error occurs
NullPointerException
- if ab
is
null
IndexOutOfBoundsException
- if of
is negative,
or cb
is negative, or of+cb
is
greater than ab.length
public void writeBoolean(boolean f) throws IOException
f
.
writeBoolean
in interface DataOutput
f
- the boolean to be written
IOException
- if an I/O error occurspublic void writeByte(int b) throws IOException
b
. The 24
high-order bits of b
are ignored.
writeByte
in interface DataOutput
b
- the byte to write (passed as an integer)
IOException
- if an I/O error occurspublic void writeShort(int n) throws IOException
n
; the 16 high-order bits of n
are
ignored.
writeShort
in interface DataOutput
n
- the short to write (passed as an integer)
IOException
- if an I/O error occurspublic void writeChar(int ch) throws IOException
ch
; the 16 high-order bits of ch
are
ignored.
writeChar
in interface DataOutput
ch
- the char to write (passed as an integer)
IOException
- if an I/O error occurspublic void writeInt(int n) throws IOException
writeInt
in interface DataOutput
n
- the int to write
IOException
- if an I/O error occurspublic void writeLong(long l) throws IOException
writeLong
in interface DataOutput
l
- the long to write
IOException
- if an I/O error occurspublic void writeFloat(float fl) throws IOException
writeFloat
in interface DataOutput
fl
- the float to write
IOException
- if an I/O error occurspublic void writeDouble(double dfl) throws IOException
writeDouble
in interface DataOutput
dfl
- the double to write
IOException
- if an I/O error occurspublic void writeBytes(String s) throws IOException
s
, but only the low-order byte from each
character of the String is written.
writeBytes
in interface DataOutput
s
- the String to write
IOException
- if an I/O error occurs
NullPointerException
- if s
is null
public void writeChars(String s) throws IOException
s
as a sequence of characters.
writeChars
in interface DataOutput
s
- the String to write
IOException
- if an I/O error occurs
NullPointerException
- if s
is null
public void writeUTF(String s) throws IOException
s
as a sequence of characters, but using
UTF-8 encoding for the characters, and including the String length data
so that the corresponding DataInput.readUTF()
method can
reconstitute a String from the written data.
writeUTF
in interface DataOutput
s
- the String to write
IOException
- if an I/O error occurs
NullPointerException
- if s
is null
public void flush() throws IOException
flush
in interface OutputStreaming
flush
in interface Flushable
flush
in class OutputStream
IOException
- if an I/O error occurspublic void close() throws IOException
close
in interface OutputStreaming
close
in interface Closeable
close
in class OutputStream
IOException
- if an I/O error occurs
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |