Package com.yahoo.io
Class ByteWriter
- java.lang.Object
-
- java.io.Writer
-
- com.yahoo.text.GenericWriter
-
- com.yahoo.io.AbstractByteWriter
-
- com.yahoo.io.ByteWriter
-
- All Implemented Interfaces:
WritableByteTransmitter
,java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
public class ByteWriter extends AbstractByteWriter
A buffered writer which accepts byte arrays in addition to character arrays.- Author:
- Steinar Knutsen
-
-
Field Summary
-
Fields inherited from class com.yahoo.io.AbstractByteWriter
buffer, charBuffer, encoder
-
-
Constructor Summary
Constructors Constructor Description ByteWriter(java.io.OutputStream stream)
ByteWriter(java.io.OutputStream stream, java.nio.charset.CharsetEncoder encoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
void
send(java.nio.ByteBuffer b)
-
Methods inherited from class com.yahoo.io.AbstractByteWriter
append, append, append, append, appended, getEncoding, write, write, write, write, write, write, write, write
-
Methods inherited from class com.yahoo.text.GenericWriter
write, write, write
-
-
-
-
Method Detail
-
send
public void send(java.nio.ByteBuffer b) throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.io.Writer
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Specified by:
flush
in classjava.io.Writer
- Throws:
java.io.IOException
-
-