PARAGRAPH_DELIMETER, PARAGRAPH_SEPARATOR, SEEK_CUR, SEEK_END, SEEK_SET| Constructor and Description |
|---|
CRLFStreamWrapper(Stream stream) |
| Modifier and Type | Method and Description |
|---|---|
int |
bufferedAvailable() |
void |
clearerr() |
void |
fclose() |
boolean |
feof()
Return true when at end of file (EOF).
|
int |
fflush() |
int |
fgetc() |
long |
fgetpos()
Get the current position within the file associated with this
handler.
|
org.jruby.util.ByteList |
fgets(org.jruby.util.ByteList separatorString) |
void |
fputc(int c) |
org.jruby.util.ByteList |
fread(int number) |
void |
freopen(Ruby runtime,
String path,
ModeFlags modes) |
void |
ftruncate(long newLength) |
int |
fwrite(org.jruby.util.ByteList string) |
ByteBuffer |
getBuffer() |
Channel |
getChannel() |
ChannelDescriptor |
getDescriptor() |
int |
getline(org.jruby.util.ByteList dst,
byte terminator)
Read all bytes up to and including a terminator byte.
|
int |
getline(org.jruby.util.ByteList dst,
byte terminator,
long limit)
Reads all bytes up to and including a terminator byte or until limit is reached.
|
ModeFlags |
getModes() |
boolean |
isAutoclose() |
boolean |
isBinmode() |
boolean |
isBlocking() |
boolean |
isSync() |
void |
lseek(long offset,
int type)
Perform a seek based on pos().
|
InputStream |
newInputStream() |
OutputStream |
newOutputStream() |
org.jruby.util.ByteList |
read(int number) |
org.jruby.util.ByteList |
readall() |
boolean |
readDataBuffered() |
int |
ready()
Implement IO#ready? as per io/wait in MRI.
|
int |
refillBuffer() |
void |
setAutoclose(boolean autoclose) |
void |
setBinmode() |
void |
setBlocking(boolean blocking) |
void |
setModes(ModeFlags modes) |
void |
setSync(boolean sync) |
void |
sync()
Flush and sync all writes to the filesystem.
|
int |
ungetc(int c) |
void |
waitUntilReady()
Implement IO#wait as per io/wait in MRI.
|
boolean |
writeDataBuffered() |
public CRLFStreamWrapper(Stream stream)
public ChannelDescriptor getDescriptor()
getDescriptor in interface Streampublic ByteBuffer getBuffer()
public int bufferedAvailable()
bufferedAvailable in interface Streampublic void setBinmode()
setBinmode in interface Streampublic boolean isAutoclose()
isAutoclose in interface Streampublic void setAutoclose(boolean autoclose)
setAutoclose in interface Streampublic org.jruby.util.ByteList fgets(org.jruby.util.ByteList separatorString)
throws IOException,
BadDescriptorException,
EOFException
fgets in interface StreamIOExceptionBadDescriptorExceptionEOFExceptionpublic org.jruby.util.ByteList readall()
throws IOException,
BadDescriptorException,
EOFException
readall in interface StreamIOExceptionBadDescriptorExceptionEOFExceptionpublic int getline(org.jruby.util.ByteList dst,
byte terminator)
throws 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.IOExceptionBadDescriptorExceptionpublic int getline(org.jruby.util.ByteList dst,
byte terminator,
long limit)
throws 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 foundIOExceptionBadDescriptorExceptionpublic org.jruby.util.ByteList fread(int number)
throws IOException,
BadDescriptorException,
EOFException
fread in interface StreamIOExceptionBadDescriptorExceptionEOFExceptionpublic int fwrite(org.jruby.util.ByteList string)
throws IOException,
BadDescriptorException
fwrite in interface StreamIOExceptionBadDescriptorExceptionpublic int fgetc()
throws IOException,
BadDescriptorException,
EOFException
fgetc in interface StreamIOExceptionBadDescriptorExceptionEOFExceptionpublic void fputc(int c)
throws IOException,
BadDescriptorException
fputc in interface StreamIOExceptionBadDescriptorExceptionpublic org.jruby.util.ByteList read(int number)
throws IOException,
BadDescriptorException,
EOFException
read in interface StreamIOExceptionBadDescriptorExceptionEOFExceptionpublic void fclose()
throws IOException,
BadDescriptorException
fclose in interface StreamIOExceptionBadDescriptorExceptionpublic int fflush()
throws IOException,
BadDescriptorException
fflush in interface StreamIOExceptionBadDescriptorExceptionpublic void sync()
throws IOException,
BadDescriptorException
StreamFlush and sync all writes to the filesystem.
sync in interface StreamIOException - if the sync does not workBadDescriptorExceptionpublic boolean feof()
throws IOException,
BadDescriptorException
StreamReturn true when at end of file (EOF).
feof in interface StreamIOExceptionBadDescriptorExceptionpublic long fgetpos()
throws IOException,
PipeException,
BadDescriptorException,
InvalidValueException
StreamGet the current position within the file associated with this handler.
fgetpos in interface StreamIOExceptionPipeException - ESPIPE (illegal seek) when not a fileBadDescriptorExceptionInvalidValueExceptionpublic void lseek(long offset,
int type)
throws IOException,
InvalidValueException,
PipeException,
BadDescriptorException
StreamPerform a seek based on pos().
lseek in interface StreamIOExceptionInvalidValueExceptionPipeExceptionBadDescriptorExceptionpublic void ftruncate(long newLength)
throws IOException,
PipeException,
InvalidValueException,
BadDescriptorException
ftruncate in interface StreamIOExceptionPipeExceptionInvalidValueExceptionBadDescriptorExceptionpublic int ready()
throws IOException
Streamready in interface StreamIOExceptionpublic void waitUntilReady()
throws IOException,
InterruptedException
StreamwaitUntilReady in interface StreamIOExceptionInterruptedExceptionpublic boolean readDataBuffered()
readDataBuffered in interface Streampublic boolean writeDataBuffered()
writeDataBuffered in interface Streampublic InputStream newInputStream()
newInputStream in interface Streampublic OutputStream newOutputStream()
newOutputStream in interface Streampublic boolean isBlocking()
isBlocking in interface Streampublic void setBlocking(boolean blocking)
throws IOException
setBlocking in interface StreamIOExceptionpublic void freopen(Ruby runtime, String path, ModeFlags modes) throws DirectoryAsFileException, IOException, InvalidValueException, PipeException, BadDescriptorException
freopen in interface StreamDirectoryAsFileExceptionIOExceptionInvalidValueExceptionPipeExceptionBadDescriptorExceptionpublic Channel getChannel()
getChannel in interface Streampublic final int refillBuffer()
throws IOException
refillBuffer in interface StreamIOExceptionCopyright © 2001-2015 JRuby. All Rights Reserved.