@ThreadSafe @CleanupObligation public final class PipedOutputStream extends OutputStream
Modifier and Type | Class and Description |
---|---|
class |
PipedOutputStream.PipedInputStream |
Constructor and Description |
---|
PipedOutputStream() |
PipedOutputStream(int bufferSize) |
PipedOutputStream(int bufferSize,
long globalDeadlineMillis)
Deprecated.
use constructor that takes globalDeadlineNanos.
|
PipedOutputStream(int bufferSize,
SizedRecyclingSupplier<byte[]> bufferProvider) |
PipedOutputStream(int bufferSize,
SizedRecyclingSupplier<byte[]> bufferProvider,
Long globalDeadlineMillis)
Deprecated.
use constructor that takes globalDeadlineNanos.
|
PipedOutputStream(long globalDeadlineNanos,
int bufferSize)
Create a PipedOutputStream with a global deadline relative to System.nanoTime().
|
PipedOutputStream(Long globalDeadlineNanos,
int bufferSize,
SizedRecyclingSupplier<byte[]> bufferProvider)
Create a PipedOutputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
close(Exception ex)
Close this piped output stream, and provide a exception reason.
|
void |
flush() |
InputStream |
getInputStream() |
long |
getNanoDeadline() |
byte[] |
getUnreadBytesFromBuffer() |
String |
toString() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeUntil(byte[] b,
int off,
int len,
long deadlineNanos) |
void |
writeUntil(int b,
long deadlineNanos) |
write
public PipedOutputStream()
public PipedOutputStream(int bufferSize)
@Deprecated public PipedOutputStream(int bufferSize, long globalDeadlineMillis)
public PipedOutputStream(long globalDeadlineNanos, int bufferSize)
globalDeadlineNanos
- deadline relative to System.nanoTime().bufferSize
- the buffer size.public PipedOutputStream(int bufferSize, SizedRecyclingSupplier<byte[]> bufferProvider)
@Deprecated public PipedOutputStream(int bufferSize, SizedRecyclingSupplier<byte[]> bufferProvider, @Nullable Long globalDeadlineMillis)
public PipedOutputStream(@Nullable Long globalDeadlineNanos, int bufferSize, SizedRecyclingSupplier<byte[]> bufferProvider)
globalDeadlineNanos
- the deadline relative to System.nanoTime().bufferSize
- the buffer size in bytes.bufferProvider
- a buffer provider. (to allow more efficient recycling)public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public long getNanoDeadline()
public void writeUntil(byte[] b, int off, int len, long deadlineNanos) throws IOException
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void writeUntil(int b, long deadlineNanos) throws IOException
IOException
public void flush()
flush
in interface Flushable
flush
in class OutputStream
@DischargesObligation public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
@DischargesObligation public void close(Exception ex)
ex
- the exception to use as root cause.public InputStream getInputStream()
public byte[] getUnreadBytesFromBuffer()
Copyright © 2018 SPF4J. All rights reserved.