| Modifier and Type | Field and Description |
|---|---|
| private boolean | closefd
true if the underlying file is actually closed on close() |
| private InputStream | inputStream
The original InputStream if one was passed in, used for __tojava__ |
| private OutputStream | outputStream
The original OutputStream if one was passed in, used for __tojava__ |
| private ReadableByteChannel | readChannel
The underlying read channel |
| private WritableByteChannel | writeChannel
The underlying write channel |
| Access | Constructor and Description |
|---|---|
| public | StreamIO(ReadableByteChannel
a ReadableByteChannel readChannel, boolean boolean whether the underlying file is closed on
close() (defaults to True) closefd)Construct a StreamIO for the given read channel. |
| public | StreamIO(ReadableByteChannel
a ReadableByteChannel readChannel)Construct a StreamIO for the given read channel. |
| public | StreamIO(WritableByteChannel
a WritableByteChannel writeChannel, boolean boolean whether the underlying file is closed on
close() (defaults to True) closefd)Construct a StreamIO for the given write channel. |
| public | StreamIO(WritableByteChannel
a WritableByteChannel writeChannel)Construct a StreamIO for the given write channel. |
| public | StreamIO(InputStream
an InputStream inputStream, boolean boolean whether the underlying file is closed on
close() (defaults to True) closefd)Construct a StreamIO for the given read/write streams. |
| public | StreamIO(OutputStream
an OutputStream outputStream, boolean boolean whether the underlying file is closed on
close() (defaults to True) closefd)Construct a StreamIO for the given read/write streams. |
| Modifier and Type | Method and Description |
|---|---|
| public InputStream | asInputStream()
Overrides org. Coerce this into an InputStream if possible, or return null. |
| public OutputStream | asOutputStream()
Overrides org. Coerce this into an OutputStream if possible, or return null. |
| public void | |
| public void | |
| public Channel | getChannel()
Implements abstract org. Return the underlying Java nio Channel. |
| private static FileDescriptor | |
| private static FileDescriptor | |
| public boolean | isatty()
Overrides org. Returns whether this is an 'interactive' stream. |
| private static ReadableByteChannel | |
| public boolean | readable()
Overrides org. Return whether this file was opened for reading. |
| public int | readinto(ByteBuffer
a ByteBuffer to read bytes into buf)Overrides org. Read up to buf.remaining() bytes into buf. |
| public boolean | writable()
Overrides org. Return whether this file was opened for writing. |
| public int | write(ByteBuffer
a ByteBuffer value buf)Overrides org. Write the given ByteBuffer to the IO stream. |
| closefd | back to summary |
|---|---|
| private boolean closefd true if the underlying file is actually closed on close() | |
| inputStream | back to summary |
|---|---|
| private InputStream inputStream The original InputStream if one was passed in, used for __tojava__ | |
| outputStream | back to summary |
|---|---|
| private OutputStream outputStream The original OutputStream if one was passed in, used for __tojava__ | |
| readChannel | back to summary |
|---|---|
| private ReadableByteChannel readChannel The underlying read channel | |
| writeChannel | back to summary |
|---|---|
| private WritableByteChannel writeChannel The underlying write channel | |
| StreamIO | back to summary |
|---|---|
| public StreamIO(ReadableByteChannel readChannel, boolean closefd) Construct a StreamIO for the given read channel.
| |
| StreamIO | back to summary |
|---|---|
| public StreamIO(ReadableByteChannel readChannel) Construct a StreamIO for the given read channel.
| |
| StreamIO | back to summary |
|---|---|
| public StreamIO(WritableByteChannel writeChannel, boolean closefd) Construct a StreamIO for the given write channel.
| |
| StreamIO | back to summary |
|---|---|
| public StreamIO(WritableByteChannel writeChannel) Construct a StreamIO for the given write channel.
| |
| StreamIO | back to summary |
|---|---|
| public StreamIO(InputStream inputStream, boolean closefd) Construct a StreamIO for the given read/write streams.
| |
| StreamIO | back to summary |
|---|---|
| public StreamIO(OutputStream outputStream, boolean closefd) Construct a StreamIO for the given read/write streams.
| |
| asInputStream | back to summary |
|---|---|
| public InputStream asInputStream() Overrides org. Doc from org. Coerce this into an InputStream if possible, or return null.
| |
| asOutputStream | back to summary |
|---|---|
| public OutputStream asOutputStream() Overrides org. Doc from org. Coerce this into an OutputStream if possible, or return null.
| |
| close | back to summary |
|---|---|
| public void close() Overrides org. Doc from org. Flushes and closes the IO object. This must be idempotent. It should also set a flag for the 'closed' property (see below) to test.
| |
| flush | back to summary |
|---|---|
| public void flush() Overrides org. Doc from org. Flushes write buffers, if applicable. This is a no-op for read-only and non-blocking streams.
| |
| getChannel | back to summary |
|---|---|
| public Channel getChannel() Implements abstract org. Doc from org. Return the underlying Java nio Channel. | |
| getInputFileDescriptor | back to summary |
|---|---|
| private static FileDescriptor getInputFileDescriptor(InputStream stream) throws IOException Unwrap one or more nested FilterInputStreams. | |
| getOutputFileDescriptor | back to summary |
|---|---|
| private static FileDescriptor getOutputFileDescriptor(OutputStream stream) throws IOException Unwrap one or more nested FilterOutputStreams. | |
| isatty | back to summary |
|---|---|
| public boolean isatty() Overrides org. Doc from org. Returns whether this is an 'interactive' stream. Returns False if we don't know.
| |
| newChannel | back to summary |
|---|---|
| private static ReadableByteChannel newChannel(InputStream in) | |
| readable | back to summary |
|---|---|
| public boolean readable() Overrides org. Doc from org. Return whether this file was opened for reading.
| |
| readinto | back to summary |
|---|---|
| public int readinto(ByteBuffer buf) Overrides org. Doc from org. Read up to buf.remaining() bytes into buf. Returns number of bytes read (0 for EOF).
| |
| writable | back to summary |
|---|---|
| public boolean writable() Overrides org. Doc from org. Return whether this file was opened for writing.
| |
| write | back to summary |
|---|---|
| public int write(ByteBuffer buf) Overrides org. Doc from org. Write the given ByteBuffer to the IO stream. Returns the number of bytes written, which may be less than buf.remaining().
| |