de.netseeker.ejoe.io
Class ByteBufferOutputStream
java.lang.Object
java.io.OutputStream
de.netseeker.ejoe.io.ByteBufferOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
public class ByteBufferOutputStream
- extends java.io.OutputStream
Implements an input stream for a NIO ByteBuffer. This class is based on an article found at the homepage of Michael
W. Spille.
- Since:
- 0.3.0
- Author:
- Michael W. Spille, netseeker aka Michael Manske
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteBufferOutputStream
public ByteBufferOutputStream()
ByteBufferOutputStream
public ByteBufferOutputStream(int startingSize)
- Parameters:
startingSize
-
ByteBufferOutputStream
public ByteBufferOutputStream(java.nio.ByteBuffer buffer)
- Parameters:
buffer
-
reset
public void reset()
- Reset the underlying byte buffer back to the starting state
getBackingBuffer
public java.nio.ByteBuffer getBackingBuffer()
- Returns:
write
public void write(int b)
throws java.io.IOException
- Specified by:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b,
int off,
int len)
- Overrides:
write
in class java.io.OutputStream
write
public void write(java.nio.ByteBuffer b)
- Parameters:
b
-
putInt
public void putInt(int i)
flush
public void flush()
- Specified by:
flush
in interface java.io.Flushable
- Overrides:
flush
in class java.io.OutputStream
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.OutputStream
- Throws:
java.io.IOException
Copyright © 2005-2007 netseeker. All Rights Reserved.