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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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
writeUTF(String s)
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Method Detail
-
write
public void write(int b) throws IOException
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
public void write(byte[] b) throws IOException
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
public void write(byte[] b, int off, int len) throws IOException
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
public void flush() throws IOException
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
public void close() throws IOException
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
public void writeDouble(double v) throws IOException
- Specified by:
writeDouble
in interfaceDataOutput
- Throws:
IOException
-
writeFloat
public void writeFloat(float v) throws IOException
- Specified by:
writeFloat
in interfaceDataOutput
- Throws:
IOException
-
writeByte
public void writeByte(int v) throws IOException
- Specified by:
writeByte
in interfaceDataOutput
- Throws:
IOException
-
writeChar
public void writeChar(int v) throws IOException
- Specified by:
writeChar
in interfaceDataOutput
- Throws:
IOException
-
writeInt
public void writeInt(int v) throws IOException
- Specified by:
writeInt
in interfaceDataOutput
- Throws:
IOException
-
writeShort
public void writeShort(int v) throws IOException
- Specified by:
writeShort
in interfaceDataOutput
- Throws:
IOException
-
writeLong
public void writeLong(long v) throws IOException
- Specified by:
writeLong
in interfaceDataOutput
- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean v) throws IOException
- Specified by:
writeBoolean
in interfaceDataOutput
- Throws:
IOException
-
writeBytes
public void writeBytes(String s) throws IOException
- Specified by:
writeBytes
in interfaceDataOutput
- Throws:
IOException
-
writeChars
public void writeChars(String s) throws IOException
- Specified by:
writeChars
in interfaceDataOutput
- Throws:
IOException
-
writeUTF
public void writeUTF(String s) throws IOException
- Specified by:
writeUTF
in interfaceDataOutput
- Throws:
IOException
-
-