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:
java.io.Closeable
,java.io.DataOutput
,java.io.Flushable
,java.lang.AutoCloseable
public class ExposedDataOutputStream extends java.io.DataOutputStream
- Version:
- $Id: ExposedDataOutputStream.java,v 1.2.4.1 2008/10/28 09:32:36 belaban Exp $
- Author:
- Bela Ban
-
-
Constructor Summary
Constructors Constructor Description ExposedDataOutputStream(java.io.OutputStream out)
Creates a new data output stream to write data to the specified underlying output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.OutputStream
getOutputStream()
void
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
-
-
-
-
Constructor Detail
-
ExposedDataOutputStream
public ExposedDataOutputStream(java.io.OutputStream out)
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:
FilterOutputStream.out
-
-
Method Detail
-
reset
public void reset()
-
getOutputStream
public java.io.OutputStream getOutputStream()
-
write
public void write(int b) throws java.io.IOException
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 interfacejava.io.DataOutput
- Overrides:
write
in classjava.io.DataOutputStream
- Parameters:
b
- thebyte
to be written.- Throws:
java.io.IOException
- if an I/O error occurs.- See Also:
FilterOutputStream.out
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException
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 interfacejava.io.DataOutput
- Overrides:
write
in classjava.io.DataOutputStream
- Parameters:
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.- Throws:
java.io.IOException
- if an I/O error occurs.- See Also:
FilterOutputStream.out
-
-