Package org.jgroups.util
Class ExposedDataOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
org.jgroups.util.ExposedDataOutputStream
- All Implemented Interfaces:
Closeable
,DataOutput
,Flushable
,AutoCloseable
- Version:
- $Id: ExposedDataOutputStream.java,v 1.2.4.1 2008/10/28 09:32:36 belaban Exp $
- Author:
- Bela Ban
-
Field Summary
Fields inherited from class java.io.DataOutputStream
written
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new data output stream to write data to the specified underlying output stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
reset()
void
write
(byte[] b, int off, int len) Writeslen
bytes from the specified byte array starting at offsetoff
to the underlying output stream.void
write
(int b) Writes the specified byte (the low eight bits of the argumentb
) to the underlying output stream.Methods inherited from class java.io.DataOutputStream
flush, size, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
Methods inherited from class java.io.FilterOutputStream
close, write
Methods inherited from class java.io.OutputStream
nullOutputStream
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.io.DataOutput
write
-
Constructor Details
-
ExposedDataOutputStream
Creates a new data output stream to write data to the specified underlying output stream. The counterwritten
is set to zero.- Parameters:
out
- the underlying output stream, to be saved for later use.- See Also:
-
-
Method Details
-
reset
public void reset() -
getOutputStream
-
write
Writes the specified byte (the low eight bits of the argumentb
) to the underlying output stream. If no exception is thrown, the counterwritten
is incremented by1
.Implements the
write
method ofOutputStream
.- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classDataOutputStream
- Parameters:
b
- thebyte
to be written.- Throws:
IOException
- if an I/O error occurs.- See Also:
-
write
Writeslen
bytes from the specified byte array starting at offsetoff
to the underlying output stream. If no exception is thrown, the counterwritten
is incremented bylen
.- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classDataOutputStream
- Parameters:
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.- Throws:
IOException
- if an I/O error occurs.- See Also:
-