|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jruby.util.io.CRLFStreamWrapper
public class CRLFStreamWrapper
Wrapper around Stream that packs and unpacks LF <=> CRLF.
| Field Summary |
|---|
| Fields inherited from interface org.jruby.util.io.Stream |
|---|
PARAGRAPH_DELIMETER, PARAGRAPH_SEPARATOR, SEEK_CUR, SEEK_END, SEEK_SET |
| Constructor Summary | |
|---|---|
CRLFStreamWrapper(Stream stream)
|
|
| Method Summary | |
|---|---|
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,
java.lang.String path,
ModeFlags modes)
|
void |
ftruncate(long newLength)
|
int |
fwrite(org.jruby.util.ByteList string)
|
java.nio.channels.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 |
isBlocking()
|
boolean |
isSync()
|
void |
lseek(long offset,
int type)
Perform a seek based on pos(). |
java.io.InputStream |
newInputStream()
|
java.io.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. |
void |
setAutoclose(boolean autoclose)
|
void |
setBinmode()
|
void |
setBlocking(boolean blocking)
|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CRLFStreamWrapper(Stream stream)
| Method Detail |
|---|
public ChannelDescriptor getDescriptor()
getDescriptor in interface Streampublic void clearerr()
clearerr in interface Streampublic ModeFlags getModes()
getModes in interface Streampublic boolean isSync()
isSync in interface Streampublic void setSync(boolean sync)
setSync in interface Streampublic void setBinmode()
setBinmode in interface Streampublic boolean isAutoclose()
isAutoclose in interface Streampublic void setAutoclose(boolean autoclose)
setAutoclose in interface Stream
public org.jruby.util.ByteList fgets(org.jruby.util.ByteList separatorString)
throws java.io.IOException,
BadDescriptorException,
java.io.EOFException
fgets in interface Streamjava.io.IOException
BadDescriptorException
java.io.EOFException
public org.jruby.util.ByteList readall()
throws java.io.IOException,
BadDescriptorException,
java.io.EOFException
readall in interface Streamjava.io.IOException
BadDescriptorException
java.io.EOFException
public int getline(org.jruby.util.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.IOException
BadDescriptorException
public int getline(org.jruby.util.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 found
java.io.IOException
BadDescriptorException
public org.jruby.util.ByteList fread(int number)
throws java.io.IOException,
BadDescriptorException,
java.io.EOFException
fread in interface Streamjava.io.IOException
BadDescriptorException
java.io.EOFException
public int fwrite(org.jruby.util.ByteList string)
throws java.io.IOException,
BadDescriptorException
fwrite in interface Streamjava.io.IOException
BadDescriptorException
public int fgetc()
throws java.io.IOException,
BadDescriptorException,
java.io.EOFException
fgetc in interface Streamjava.io.IOException
BadDescriptorException
java.io.EOFExceptionpublic int ungetc(int c)
ungetc in interface Stream
public void fputc(int c)
throws java.io.IOException,
BadDescriptorException
fputc in interface Streamjava.io.IOException
BadDescriptorException
public org.jruby.util.ByteList read(int number)
throws java.io.IOException,
BadDescriptorException,
java.io.EOFException
read in interface Streamjava.io.IOException
BadDescriptorException
java.io.EOFException
public void fclose()
throws java.io.IOException,
BadDescriptorException
fclose in interface Streamjava.io.IOException
BadDescriptorException
public int fflush()
throws java.io.IOException,
BadDescriptorException
fflush in interface Streamjava.io.IOException
BadDescriptorException
public 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 work
BadDescriptorException
public boolean feof()
throws java.io.IOException,
BadDescriptorException
StreamReturn true when at end of file (EOF).
feof in interface Streamjava.io.IOException
BadDescriptorException
public long fgetpos()
throws java.io.IOException,
PipeException,
BadDescriptorException,
InvalidValueException
StreamGet the current position within the file associated with this handler.
fgetpos in interface Streamjava.io.IOException
PipeException - ESPIPE (illegal seek) when not a file
BadDescriptorException
InvalidValueException
public void lseek(long offset,
int type)
throws java.io.IOException,
InvalidValueException,
PipeException,
BadDescriptorException
StreamPerform a seek based on pos().
lseek in interface Streamjava.io.IOException
InvalidValueException
PipeException
BadDescriptorException
public void ftruncate(long newLength)
throws java.io.IOException,
PipeException,
InvalidValueException,
BadDescriptorException
ftruncate in interface Streamjava.io.IOException
PipeException
InvalidValueException
BadDescriptorException
public int ready()
throws java.io.IOException
Stream
ready in interface Streamjava.io.IOException
public void waitUntilReady()
throws java.io.IOException,
java.lang.InterruptedException
Stream
waitUntilReady in interface Streamjava.io.IOException
java.lang.InterruptedExceptionpublic boolean readDataBuffered()
readDataBuffered in interface Streampublic boolean writeDataBuffered()
writeDataBuffered in interface Streampublic java.io.InputStream newInputStream()
newInputStream in interface Streampublic java.io.OutputStream newOutputStream()
newOutputStream in interface Streampublic boolean isBlocking()
isBlocking in interface Stream
public void setBlocking(boolean blocking)
throws java.io.IOException
setBlocking in interface Streamjava.io.IOException
public void freopen(Ruby runtime,
java.lang.String path,
ModeFlags modes)
throws DirectoryAsFileException,
java.io.IOException,
InvalidValueException,
PipeException,
BadDescriptorException
freopen in interface StreamDirectoryAsFileException
java.io.IOException
InvalidValueException
PipeException
BadDescriptorExceptionpublic java.nio.channels.Channel getChannel()
getChannel in interface Stream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||