public class NodeOutputStream extends OutputStream
NodeInputStream
can
reconstruct the stream from permanent storage.
flush() is also called automatically every
BUFFER_SWITCH_SIZE bytes, to keep our memory
requirements low.
Meant to be used when running background servlets:
we want to save their output in a way that
survives system restart.Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_SIZE |
static int |
BUFFER_SWITCH_SIZE |
static String |
STREAM_NODE_TYPE
Node type for our stream nodes
|
Constructor and Description |
---|
NodeOutputStream(javax.jcr.Node n) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Calls flush to persist our stream, before closing
|
void |
flush()
Store the contents of our buffer to a new Property under our
node, numbered sequentially.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public static final String STREAM_NODE_TYPE
public static final int BUFFER_SIZE
public static final int BUFFER_SWITCH_SIZE
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.