Package com.tangosol.util
Class NullImplementation.NullOutputStream
java.lang.Object
java.io.OutputStream
com.tangosol.util.NullImplementation.NullOutputStream
- All Implemented Interfaces:
com.oracle.coherence.common.io.OutputStreaming
,OutputStreaming
,Closeable
,DataOutput
,Flushable
,AutoCloseable
- Enclosing class:
NullImplementation
public static class NullImplementation.NullOutputStream
extends OutputStream
implements OutputStreaming, DataOutput
An OutputStream that does basically nothing. Note that multiple
instances are required because the API dictates that the close method
must cause further invocations to all other methods to throw an
IOException.
- Author:
- cp 2000.11.01
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this OutputStream and releases any associated system resources.void
flush()
Flushes this OutputStream and forces any buffered output bytes to be written.int
size()
void
write
(byte[] b) Writes all the bytes in the arrayab
.void
write
(byte[] b, int off, int len) Writescb
bytes starting at offsetof
from the arrayab
.void
write
(int b) Writes the eight low-order bits of the argumentb
.void
writeBoolean
(boolean v) void
writeByte
(int v) void
writeBytes
(String s) void
writeChar
(int v) void
writeChars
(String s) void
writeDouble
(double v) void
writeFloat
(float v) void
writeInt
(int v) void
writeLong
(long v) void
writeShort
(int v) void
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Method Details
-
write
Writes the eight low-order bits of the argumentb
. The 24 high-order bits ofb
are ignored.- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfacecom.oracle.coherence.common.io.OutputStreaming
- Specified by:
write
in classOutputStream
- Parameters:
b
- the byte to write (passed as an integer)- Throws:
IOException
- if an I/O error occurs
-
write
Writes all the bytes in the arrayab
.- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfacecom.oracle.coherence.common.io.OutputStreaming
- Overrides:
write
in classOutputStream
- Parameters:
b
- the byte array to write- Throws:
IOException
- if an I/O error occurs
-
write
Writescb
bytes starting at offsetof
from the arrayab
.- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfacecom.oracle.coherence.common.io.OutputStreaming
- Overrides:
write
in classOutputStream
- Parameters:
b
- the byte array to write fromoff
- the offset intoab
to start writing fromlen
- the number of bytes fromab
to write- Throws:
IOException
- if an I/O error occurs
-
flush
Flushes this OutputStream and forces any buffered output bytes to be written.- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in interfacecom.oracle.coherence.common.io.OutputStreaming
- Overrides:
flush
in classOutputStream
- Throws:
IOException
- if an I/O error occurs
-
close
Closes this OutputStream and releases any associated system resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfacecom.oracle.coherence.common.io.OutputStreaming
- Overrides:
close
in classOutputStream
- Throws:
IOException
- if an I/O error occurs
-
size
public int size() -
writeDouble
- Specified by:
writeDouble
in interfaceDataOutput
- Throws:
IOException
-
writeFloat
- Specified by:
writeFloat
in interfaceDataOutput
- Throws:
IOException
-
writeByte
- Specified by:
writeByte
in interfaceDataOutput
- Throws:
IOException
-
writeChar
- Specified by:
writeChar
in interfaceDataOutput
- Throws:
IOException
-
writeInt
- Specified by:
writeInt
in interfaceDataOutput
- Throws:
IOException
-
writeShort
- Specified by:
writeShort
in interfaceDataOutput
- Throws:
IOException
-
writeLong
- Specified by:
writeLong
in interfaceDataOutput
- Throws:
IOException
-
writeBoolean
- Specified by:
writeBoolean
in interfaceDataOutput
- Throws:
IOException
-
writeBytes
- Specified by:
writeBytes
in interfaceDataOutput
- Throws:
IOException
-
writeChars
- Specified by:
writeChars
in interfaceDataOutput
- Throws:
IOException
-
writeUTF
- Specified by:
writeUTF
in interfaceDataOutput
- Throws:
IOException
-