public abstract class LImport
extends java.lang.Object
Constructor and Description |
---|
LImport() |
Modifier and Type | Method and Description |
---|---|
abstract int |
available() |
abstract void |
close() |
LShrinkArray |
correctForCompression()
Assumes the contents of the ShrinkArray is raw zipped data in its
entirety, and nothing else.
|
abstract byte[] |
extract(int amount)
Reads in amount of bytes and converts them to integers.
Moves position forward. |
byte[] |
extract(int skip,
int read)
Skips an amount of bytes, reads in amount of bytes and converts them to
integers.
Moves position forward. |
byte[] |
extractAllBytes()
Returns the remaining contents as a byte array, and adjusts bounds to be
empty.
|
java.lang.String |
extractAllString()
Extracts the remaining data and returns it as a string.
|
boolean |
extractBool(int amount) |
float |
extractFloat()
Extracts 4 bytes and returns their float representation
Bumps the lower bound up so that following extracts do not extract the same data. |
int |
extractInt(int read) |
int |
extractInt(int skip,
int read)
Reads in the desired bytes and converts them to a int (little endian
assumed).
|
int[] |
extractInts(int amount)
Extracts specified number of ints.
|
int[] |
extractInts(int skip,
int read)
Reads in the desired bytes and converts them to an int array.
|
java.lang.String |
extractLine()
Reads in a line until a newline character is found.
|
long |
extractLong(int skip,
int read)
Reads in the desired bytes and converts them to a long (little endian
assumed).
|
java.lang.String |
extractString()
Reads in characters until a null byte (0) is read, and converts them to a
string.
|
java.lang.String |
extractString(int amount)
Extracts the specified number of bytes, and returns the string
representation.
Bumps the lower bound up so that following extracts do not extract the same data. |
java.lang.String |
extractString(int skip,
int read)
Reads in the desired bytes and converts them to a string.
|
byte[] |
extractUntil(byte[]... delimiters)
Reads in bytes until any of the delimiters are read.
|
byte[] |
extractUntil(char delimiter)
Reads in bytes until the delimiter is read.
|
byte[] |
extractUntil(char delimiter,
int bufsize)
Reads in bytes until the delimiter is read.
|
byte[] |
extractUntil(int delimiter)
Reads in bytes until the delimiter is read.
|
byte[] |
extractUntil(int delimiter,
int bufsize)
Reads in bytes until the delimiter is read.
|
byte[] |
getAllBytes()
Returns the remaining contents as a byte array, but does NOT adjust the
bounds.
|
byte[] |
getBytes(int skip,
int amount)
Gets specified number of bytes after skipping the desired amount.
|
int[] |
getInts(int skip,
int read)
Skips an amount of bytes, reads in amount of bytes and converts them to
integers.
Does NOT move position. |
java.lang.String |
getString(int amount)
Gets specified number of bytes and converts them to a string.
|
java.lang.String |
getString(int skip,
int amount)
Gets specified number of bytes after skipping the desired amount and
converts them to a string.
|
java.lang.Boolean |
isDone() |
void |
jumpBack(int amount)
Moves position back an amount of bytes.
|
abstract long |
pos() |
abstract void |
pos(long pos) |
int |
read()
Reads in one integer and moves the position up one
|
java.lang.String |
scanTo(java.lang.String... targets)
Uses an LStringSearcher to read file contents until one of the targets is
found.
|
void |
skip(int offset)
Bumps the position the desired offset.
|
public int read()
public final long extractLong(int skip, int read)
skip
- Bytes to skipread
- Bytes to read and convertpublic final java.lang.String extractString(int skip, int read)
skip
- Bytes to skipread
- Bytes to read and convertpublic java.lang.String extractString(int amount)
amount
- Amount to read.public final int extractInt(int skip, int read)
skip
- Bytes to skipread
- Bytes to read and convertpublic final int extractInt(int read)
read
- public final int[] extractInts(int skip, int read)
skip
- Bytes to skipread
- Bytes to read and convertpublic int[] extractInts(int amount)
amount
- Amount to read.public final int[] getInts(int skip, int read)
skip
- read
- public float extractFloat()
public boolean extractBool(int amount)
amount
- public byte[] extractAllBytes()
public java.lang.String extractString()
public java.lang.String extractAllString()
public java.lang.String extractLine()
public byte[] extractUntil(char delimiter, int bufsize)
delimiter
- char to stop reading at.bufsize
- Buffer size to hold readings.public byte[] extractUntil(char delimiter)
delimiter
- char to stop reading at.public byte[] extractUntil(int delimiter)
delimiter
- int to stop reading at.public byte[] extract(int skip, int read)
skip
- read
- public abstract byte[] extract(int amount)
amount
- public java.lang.String getString(int amount)
amount
- public java.lang.String getString(int skip, int amount)
skip
- amount
- public byte[] extractUntil(int delimiter, int bufsize)
delimiter
- Byte to stop reading at.bufsize
- Buffer size to hold readings.public byte[] extractUntil(byte[]... delimiters)
delimiters
- Byte arrays of patterns to stop reading at.public byte[] getBytes(int skip, int amount)
skip
- Amount to skip.amount
- Amount to read.public byte[] getAllBytes()
public void skip(int offset)
offset
- Desired offset.public void jumpBack(int amount)
amount
- public abstract void pos(long pos)
pos
- public abstract long pos()
public final java.lang.String scanTo(java.lang.String... targets)
targets
- public abstract void close()
public abstract int available()
public java.lang.Boolean isDone()
public LShrinkArray correctForCompression() throws java.util.zip.DataFormatException
java.util.zip.DataFormatException