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, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPosition, setPositioncloseWrite, flush, getOutputStream, print, print, write, writeseek, statpublic HttpInputOutput(Env env, Path path, StreamContextResource context) throws java.io.IOException
java.io.IOExceptionpublic void write(int ch)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic StringValue appendTo(StringValue builder) throws java.io.IOException
appendTo in interface BinaryInputjava.io.IOExceptionpublic java.io.InputStream getInputStream()
getInputStream in interface BinaryInputpublic int getAvailable()
throws java.io.IOException
getAvailable in interface BinaryInputjava.io.IOExceptionpublic BinaryInput openCopy() throws java.io.IOException
openCopy in interface BinaryInputjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in interface BinaryInputjava.io.IOExceptionpublic int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in interface BinaryInputjava.io.IOExceptionpublic int read(char[] buffer,
int offset,
int length)
throws java.io.IOException
java.io.IOExceptionpublic StringValue read(int length) throws java.io.IOException
read in interface BinaryInputjava.io.IOExceptionpublic StringValue readLine(long length) throws java.io.IOException
readLine in interface BinaryInputjava.io.IOExceptionpublic boolean readOptionalLinefeed()
throws java.io.IOException
readOptionalLinefeed in interface BinaryInputjava.io.IOExceptionpublic boolean isEOF()
isEOF in interface BinaryStreamisEOF in class AbstractBinaryOutputpublic void setEncoding(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
encoding - name of the read encodingjava.io.UnsupportedEncodingExceptionpublic void unread()
throws java.io.IOException
unread in interface BinaryInputjava.io.IOExceptionpublic boolean lock(boolean shared,
boolean block)
LockableStreamlock in interface LockableStreampublic boolean unlock()
LockableStreamunlock in interface LockableStreampublic void closeRead()
closeRead in interface BinaryInputpublic void close()
close in interface BinaryInputclose in interface BinaryOutputclose in interface BinaryStreamclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class AbstractBinaryOutputpublic void cleanup()
cleanup in interface EnvCleanuppublic java.lang.String toString()
toString in class java.lang.Object