|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
org.openjena.atlas.io.BufferingWriter
public final class BufferingWriter
A buffering writer, send output to a channel (WriteableByteChannel) (and own methods which do not throw checked exceptions). Only supports UTF-8.
The java.io classes have hidden synchronization so in some very critical situations, this can be expensive (such situations are not common). This class generalises the notion of destination via the Sink abstraction (block output based on ByteBuffers).
This class is not thread safe.
PeekReader
Nested Class Summary | |
---|---|
static class |
BufferingWriter.SinkBuffer
|
static class |
BufferingWriter.SinkChannel
|
static class |
BufferingWriter.SinkOutputStream
|
Constructor Summary | |
---|---|
BufferingWriter(Sink<ByteBuffer> sink)
Create a buffering output stream of charcaters to a Sink |
|
BufferingWriter(Sink<ByteBuffer> sink,
int size,
int blobSize)
Create a buffering output stream of charcaters to a Sink |
Method Summary | |
---|---|
void |
close()
|
static BufferingWriter |
create(OutputStream out)
Writer(chars) over OutputStream (bytes) -- heavily buffered -- flushing may be needed |
static BufferingWriter |
create(OutputStream out,
int size)
Convenience operation to output to a Writer |
static BufferingWriter |
create(WritableByteChannel out)
Convenience operation to output to a WritableByteChannel |
static BufferingWriter |
create(WritableByteChannel out,
int size)
Convenience operation to output to a WritableByteChannel |
void |
flush()
|
void |
output(char[] chars)
Output an array of characters |
void |
output(char[] chars,
int start,
int finish)
Output an array of characters |
void |
output(CharSequence string)
Output characters (The String class implements CharSequence) |
void |
output(int ch)
Output a single character |
void |
write(char[] cbuf)
|
void |
write(char[] cbuf,
int off,
int len)
|
void |
write(int ch)
|
void |
write(String string)
|
Methods inherited from class java.io.Writer |
---|
append, append, append, write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BufferingWriter(Sink<ByteBuffer> sink)
Sink
public BufferingWriter(Sink<ByteBuffer> sink, int size, int blobSize)
Sink
Method Detail |
---|
public static BufferingWriter create(WritableByteChannel out)
public static BufferingWriter create(WritableByteChannel out, int size)
public static BufferingWriter create(OutputStream out)
public static BufferingWriter create(OutputStream out, int size)
public void output(CharSequence string)
public void output(char[] chars)
public void output(char[] chars, int start, int finish)
chars
- Charactersstart
- Start (inclusive)finish
- Finish (exclusive)public void output(int ch)
public void close()
close
in interface Closeable
close
in class Writer
public void flush()
flush
in interface Flushable
flush
in class Writer
public void write(char[] cbuf, int off, int len) throws IOException
write
in class Writer
IOException
public void write(char[] cbuf) throws IOException
write
in class Writer
IOException
public void write(String string) throws IOException
write
in class Writer
IOException
public void write(int ch) throws IOException
write
in class Writer
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |