public class HttpInputOutput extends AbstractBinaryOutput implements BinaryInput, BinaryOutput, LockableStream, EnvCleanup
SEEK_CUR, SEEK_END, SEEK_SET
Constructor and Description |
---|
HttpInputOutput(Env env,
Path path,
StreamContextResource context) |
Modifier and Type | Method and Description |
---|---|
StringValue |
appendTo(StringValue builder)
Appends to a string builder.
|
void |
cleanup() |
void |
close()
Closes the file.
|
void |
closeRead()
Closes the file for reading.
|
int |
getAvailable() |
java.io.InputStream |
getInputStream()
Returns the read stream.
|
boolean |
isEOF()
Returns true on the EOF.
|
boolean |
lock(boolean shared,
boolean block)
Lock the shared advisory lock.
|
BinaryInput |
openCopy()
Opens a copy.
|
int |
read()
Reads a character from a file, returning -1 on EOF.
|
int |
read(byte[] buffer,
int offset,
int length)
Reads a buffer from a file, returning -1 on EOF.
|
int |
read(char[] buffer,
int offset,
int length)
Reads a buffer from a file, returning -1 on EOF.
|
StringValue |
read(int length)
Reads a Binary string.
|
StringValue |
readLine(long length)
Reads a line from the buffer.
|
boolean |
readOptionalLinefeed()
Reads the optional linefeed character from a \r\n
|
void |
setEncoding(java.lang.String encoding)
Sets the current read encoding.
|
java.lang.String |
toString() |
boolean |
unlock()
Unlock the advisory lock.
|
void |
unread()
Unread a character.
|
void |
write(int ch) |
closeWrite, flush, getOutputStream, getPosition, getResourceType, print, print, seek, setPosition, stat, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPosition, setPosition
closeWrite, flush, getOutputStream, print, print, write, write
seek, stat
public HttpInputOutput(Env env, Path path, StreamContextResource context) throws java.io.IOException
java.io.IOException
public void write(int ch) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public StringValue appendTo(StringValue builder) throws java.io.IOException
appendTo
in interface BinaryInput
java.io.IOException
public java.io.InputStream getInputStream()
getInputStream
in interface BinaryInput
public int getAvailable() throws java.io.IOException
getAvailable
in interface BinaryInput
java.io.IOException
public BinaryInput openCopy() throws java.io.IOException
openCopy
in interface BinaryInput
java.io.IOException
public int read() throws java.io.IOException
read
in interface BinaryInput
java.io.IOException
public int read(byte[] buffer, int offset, int length) throws java.io.IOException
read
in interface BinaryInput
java.io.IOException
public int read(char[] buffer, int offset, int length) throws java.io.IOException
java.io.IOException
public StringValue read(int length) throws java.io.IOException
read
in interface BinaryInput
java.io.IOException
public StringValue readLine(long length) throws java.io.IOException
readLine
in interface BinaryInput
java.io.IOException
public boolean readOptionalLinefeed() throws java.io.IOException
readOptionalLinefeed
in interface BinaryInput
java.io.IOException
public boolean isEOF()
isEOF
in interface BinaryStream
isEOF
in class AbstractBinaryOutput
public void setEncoding(java.lang.String encoding) throws java.io.UnsupportedEncodingException
encoding
- name of the read encodingjava.io.UnsupportedEncodingException
public void unread() throws java.io.IOException
unread
in interface BinaryInput
java.io.IOException
public boolean lock(boolean shared, boolean block)
LockableStream
lock
in interface LockableStream
public boolean unlock()
LockableStream
unlock
in interface LockableStream
public void closeRead()
closeRead
in interface BinaryInput
public void close()
close
in interface BinaryInput
close
in interface BinaryOutput
close
in interface BinaryStream
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class AbstractBinaryOutput
public void cleanup()
cleanup
in interface EnvCleanup
public java.lang.String toString()
toString
in class java.lang.Object