public class Zlib
extends java.lang.Object
Constructor and Description |
---|
Zlib(Env env,
java.lang.String filename,
java.lang.String mode,
boolean useIncludePath)
XXX: todo - implement additional read/write modes (a,etc)
Creates and sets GZIP stream if mode is 'w'
Also creates _fileValue.
|
Modifier and Type | Method and Description |
---|---|
protected java.io.InputStream |
getGZIPInputStream()
helper function to open file for reading when necessary
|
boolean |
gzclose()
Closes the gzip stream
|
boolean |
gzeof() |
ArrayValue |
gzfile()
helper function for ZlibModule.gzfile
need to have created a Zlib before calling this
|
Value |
gzgetc(Env env) |
StringValue |
gzgets(int length)
Gets a (uncompressed) string of up to 'length' bytes read
from the given file pointer.
|
StringValue |
gzgetss(Env env,
int length,
StringValue allowedTags) |
int |
gzputs(Env env,
java.io.InputStream is,
int length)
alias of gzwrite
|
StringValue |
gzread(Env env,
int length)
same as gzgets but does not stop at '\n' or '\r'
|
boolean |
gzrewind()
resets to the beginning of the file stream.
|
int |
gzwrite(Env env,
java.io.InputStream is,
int length)
Reads from the input and writes to the gzip stream
|
java.lang.String |
toString() |
public Zlib(Env env, java.lang.String filename, java.lang.String mode, boolean useIncludePath)
fileName
- mode
- (ie: "w9" or "r7f")useIncludePath
- is always onpublic int gzwrite(Env env, java.io.InputStream is, int length)
s
- length
- # of bytes to compresspublic boolean gzclose()
public int gzputs(Env env, java.io.InputStream is, int length)
env
- s
- length
- public StringValue gzgets(int length)
length
- public ArrayValue gzfile()
java.io.IOException
java.util.zip.DataFormatException
public StringValue gzread(Env env, int length)
length
- java.io.IOException
java.util.zip.DataFormatException
public boolean gzeof()
public StringValue gzgetss(Env env, int length, StringValue allowedTags)
length
- allowedTags
- java.io.IOException
java.util.zip.DataFormatException
public boolean gzrewind()
java.io.IOException
protected java.io.InputStream getGZIPInputStream() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object