@Deprecated public class ChannelStream extends java.lang.Object implements Stream, Finalizable
| Modifier and Type | Field and Description |
|---|---|
protected java.nio.ByteBuffer |
buffer
Deprecated.
|
static int |
BUFSIZE
Deprecated.
The size of the read/write buffer allocated for this stream.
|
protected ModeFlags |
modes
Deprecated.
|
protected boolean |
reading
Deprecated.
|
protected boolean |
sync
Deprecated.
|
PARAGRAPH_DELIMETER, PARAGRAPH_SEPARATOR, SEEK_CUR, SEEK_END, SEEK_SET| Modifier and Type | Method and Description |
|---|---|
int |
bufferedAvailable()
Deprecated.
|
void |
checkPermissionsSubsetOf(ModeFlags subsetModes)
Deprecated.
|
void |
checkReadable()
Deprecated.
|
void |
checkWritable()
Deprecated.
|
void |
clearerr()
Deprecated.
|
void |
fclose()
Deprecated.
Closes IO handler resources.
|
static Stream |
fdopen(Ruby runtime,
ChannelDescriptor descriptor,
ModeFlags modes)
Deprecated.
|
static Stream |
fdopen(Ruby runtime,
ChannelDescriptor descriptor,
ModeFlags modes,
boolean autoclose)
Deprecated.
|
boolean |
feof()
Deprecated.
Return true when at end of file (EOF).
|
int |
fflush()
Deprecated.
|
int |
fgetc()
Deprecated.
|
long |
fgetpos()
Deprecated.
Get the current position within the file associated with this
handler.
|
ByteList |
fgets(ByteList separatorString)
Deprecated.
|
void |
finalize()
Deprecated.
Ensure close (especially flush) when we're finished with.
|
static Stream |
fopen(Ruby runtime,
java.lang.String path,
ModeFlags modes)
Deprecated.
|
void |
fputc(int c)
Deprecated.
|
ByteList |
fread(int number)
Deprecated.
|
void |
freopen(Ruby runtime,
java.lang.String path,
ModeFlags modes)
Deprecated.
|
void |
ftruncate(long newLength)
Deprecated.
|
int |
fwrite(ByteList string)
Deprecated.
|
java.nio.ByteBuffer |
getBuffer()
Deprecated.
|
java.nio.channels.Channel |
getChannel()
Deprecated.
|
ChannelDescriptor |
getDescriptor()
Deprecated.
|
int |
getline(ByteList dst,
byte terminator)
Deprecated.
Read all bytes up to and including a terminator byte.
|
int |
getline(ByteList dst,
byte terminator,
long limit)
Deprecated.
Reads all bytes up to and including a terminator byte or until limit is reached.
|
ModeFlags |
getModes()
Deprecated.
|
Ruby |
getRuntime()
Deprecated.
|
boolean |
isAutoclose()
Deprecated.
|
boolean |
isBinmode()
Deprecated.
|
boolean |
isBlocking()
Deprecated.
|
boolean |
isSync()
Deprecated.
|
void |
lseek(long offset,
int type)
Deprecated.
Implementation of libc "lseek", which seeks on seekable streams, raises
EPIPE if the fd is assocated with a pipe, socket, or FIFO, and doesn't
do anything for other cases (like stdio).
|
java.io.InputStream |
newInputStream()
Deprecated.
|
java.io.OutputStream |
newOutputStream()
Deprecated.
|
static Stream |
open(Ruby runtime,
ChannelDescriptor descriptor)
Deprecated.
|
static Stream |
open(Ruby runtime,
ChannelDescriptor descriptor,
boolean autoclose)
Deprecated.
|
int |
read()
Deprecated.
|
int |
read(java.nio.ByteBuffer dst)
Deprecated.
|
int |
read(java.nio.ByteBuffer dst,
boolean partial)
Deprecated.
|
ByteList |
read(int number)
Deprecated.
|
ByteList |
readall()
Deprecated.
readall do busy loop for the IO which has NONBLOCK bit. You
should implement the logic by yourself with fread().
|
boolean |
readDataBuffered()
Deprecated.
|
ByteList |
readnonblock(int number)
Deprecated.
|
ByteList |
readpartial(int number)
Deprecated.
|
int |
ready()
Deprecated.
Implement IO#ready? as per io/wait in MRI.
|
int |
refillBuffer()
Deprecated.
|
void |
setAutoclose(boolean autoclose)
Deprecated.
|
void |
setBinmode()
Deprecated.
|
void |
setBlocking(boolean block)
Deprecated.
|
void |
setModes(ModeFlags modes)
Deprecated.
|
void |
setSync(boolean sync)
Deprecated.
|
void |
sync()
Deprecated.
Flush and sync all writes to the filesystem.
|
int |
ungetc(int c)
Deprecated.
|
void |
waitUntilReady()
Deprecated.
Implement IO#wait as per io/wait in MRI.
|
int |
write(java.nio.ByteBuffer buf)
Deprecated.
|
boolean |
writeDataBuffered()
Deprecated.
|
int |
writenonblock(ByteList buf)
Deprecated.
|
public static final int BUFSIZE
protected ModeFlags modes
protected boolean sync
protected volatile java.nio.ByteBuffer buffer
protected boolean reading
public java.nio.ByteBuffer getBuffer()
public Ruby getRuntime()
public void checkReadable()
throws java.io.IOException
java.io.IOExceptionpublic void checkWritable()
throws java.io.IOException
java.io.IOExceptionpublic void checkPermissionsSubsetOf(ModeFlags subsetModes)
public void setModes(ModeFlags modes)
public void setBinmode()
setBinmode in interface Streampublic boolean isAutoclose()
isAutoclose in interface Streampublic void setAutoclose(boolean autoclose)
setAutoclose in interface Streampublic void waitUntilReady()
throws java.io.IOException,
java.lang.InterruptedException
waitUntilReady in interface Streamjava.io.IOExceptionjava.lang.InterruptedExceptionpublic final boolean readDataBuffered()
readDataBuffered in interface Streampublic final boolean writeDataBuffered()
writeDataBuffered in interface Streampublic final int bufferedAvailable()
bufferedAvailable in interface Streampublic final int refillBuffer()
throws java.io.IOException
refillBuffer in interface Streamjava.io.IOExceptionpublic ByteList fgets(ByteList separatorString) throws java.io.IOException, BadDescriptorException
fgets in interface Streamjava.io.IOExceptionBadDescriptorExceptionpublic int getline(ByteList dst, byte terminator) throws java.io.IOException, BadDescriptorException
StreamIf the terminator byte is found, it will be the last byte in the output buffer.
getline in interface Streamdst - The output buffer.terminator - The byte to terminate reading.java.io.IOExceptionBadDescriptorExceptionpublic int getline(ByteList dst, byte terminator, long limit) throws java.io.IOException, BadDescriptorException
StreamIf the terminator byte is found, it will be the last byte in the output buffer.
getline in interface Streamdst - The output buffer.terminator - The byte to terminate reading.limit - the number of bytes to read unless EOF or terminator is foundjava.io.IOExceptionBadDescriptorException@Deprecated public ByteList readall() throws java.io.IOException, BadDescriptorException
readall in interface Streamjava.io.IOExceptionBadDescriptorExceptionpublic void fclose()
throws java.io.IOException,
BadDescriptorException
fclose in interface Streamjava.io.IOExceptionBadDescriptorExceptionpublic int fflush()
throws java.io.IOException,
BadDescriptorException
fflush in interface Streamjava.io.IOExceptionBadDescriptorExceptionpublic java.io.InputStream newInputStream()
newInputStream in interface Streampublic java.io.OutputStream newOutputStream()
newOutputStream in interface Streampublic boolean feof()
throws java.io.IOException,
BadDescriptorException
StreamReturn true when at end of file (EOF).
feof in interface Streamjava.io.IOExceptionBadDescriptorExceptionpublic long fgetpos()
throws java.io.IOException,
PipeException,
InvalidValueException,
BadDescriptorException
StreamGet the current position within the file associated with this handler.
fgetpos in interface Streamjava.io.IOExceptionPipeException - ESPIPE (illegal seek) when not a fileInvalidValueExceptionBadDescriptorExceptionpublic void lseek(long offset,
int type)
throws java.io.IOException,
InvalidValueException,
PipeException,
BadDescriptorException
lseek in interface Streamjava.io.IOExceptionInvalidValueExceptionPipeExceptionBadDescriptorExceptionpublic void sync()
throws java.io.IOException,
BadDescriptorException
StreamFlush and sync all writes to the filesystem.
sync in interface Streamjava.io.IOException - if the sync does not workBadDescriptorExceptionpublic ByteList read(int number) throws java.io.IOException, BadDescriptorException
read in interface Streamjava.io.IOExceptionBadDescriptorExceptionpublic void ftruncate(long newLength)
throws java.io.IOException,
BadDescriptorException,
InvalidValueException
ftruncate in interface Streamjava.io.IOExceptionBadDescriptorExceptionInvalidValueExceptionpublic void finalize()
throws java.lang.Throwable
finalize in interface Finalizablefinalize in class java.lang.Objectjava.lang.Throwablepublic int ready()
throws java.io.IOException
Streampublic void fputc(int c)
throws java.io.IOException,
BadDescriptorException
fputc in interface Streamjava.io.IOExceptionBadDescriptorExceptionpublic int fgetc()
throws java.io.IOException,
BadDescriptorException
fgetc in interface Streamjava.io.IOExceptionBadDescriptorExceptionpublic int fwrite(ByteList string) throws java.io.IOException, BadDescriptorException
fwrite in interface Streamjava.io.IOExceptionBadDescriptorExceptionpublic int write(java.nio.ByteBuffer buf)
throws java.io.IOException,
BadDescriptorException
java.io.IOExceptionBadDescriptorExceptionpublic int writenonblock(ByteList buf) throws java.io.IOException, BadDescriptorException
java.io.IOExceptionBadDescriptorExceptionpublic ByteList fread(int number) throws java.io.IOException, BadDescriptorException
fread in interface Streamjava.io.IOExceptionBadDescriptorExceptionpublic ByteList readnonblock(int number) throws java.io.IOException, BadDescriptorException, java.io.EOFException
java.io.IOExceptionBadDescriptorExceptionjava.io.EOFExceptionpublic ByteList readpartial(int number) throws java.io.IOException, BadDescriptorException, java.io.EOFException
java.io.IOExceptionBadDescriptorExceptionjava.io.EOFExceptionpublic int read(java.nio.ByteBuffer dst)
throws java.io.IOException,
BadDescriptorException,
java.io.EOFException
java.io.IOExceptionBadDescriptorExceptionjava.io.EOFExceptionpublic int read(java.nio.ByteBuffer dst,
boolean partial)
throws java.io.IOException,
BadDescriptorException,
java.io.EOFException
java.io.IOExceptionBadDescriptorExceptionjava.io.EOFExceptionpublic int read()
throws java.io.IOException,
BadDescriptorException
java.io.IOExceptionBadDescriptorExceptionpublic ChannelDescriptor getDescriptor()
getDescriptor in interface Streampublic void setBlocking(boolean block)
throws java.io.IOException
setBlocking in interface Streamjava.io.IOExceptionpublic boolean isBlocking()
isBlocking in interface Streampublic void freopen(Ruby runtime, java.lang.String path, ModeFlags modes) throws DirectoryAsFileException, java.io.IOException, InvalidValueException, PipeException, BadDescriptorException
freopen in interface StreamDirectoryAsFileExceptionjava.io.IOExceptionInvalidValueExceptionPipeExceptionBadDescriptorExceptionpublic static Stream open(Ruby runtime, ChannelDescriptor descriptor)
public static Stream fdopen(Ruby runtime, ChannelDescriptor descriptor, ModeFlags modes) throws InvalidValueException
InvalidValueExceptionpublic static Stream open(Ruby runtime, ChannelDescriptor descriptor, boolean autoclose)
public static Stream fdopen(Ruby runtime, ChannelDescriptor descriptor, ModeFlags modes, boolean autoclose) throws InvalidValueException
InvalidValueException@Deprecated public static Stream fopen(Ruby runtime, java.lang.String path, ModeFlags modes) throws java.io.FileNotFoundException, DirectoryAsFileException, FileExistsException, java.io.IOException, InvalidValueException, PipeException, BadDescriptorException
java.io.FileNotFoundExceptionDirectoryAsFileExceptionFileExistsExceptionjava.io.IOExceptionInvalidValueExceptionPipeExceptionBadDescriptorExceptionpublic java.nio.channels.Channel getChannel()
getChannel in interface StreamCopyright © 2001-2020 JRuby. All Rights Reserved.