Method Summary |
|
public synchronized void | append(byte b) Appends a byte to the end of the Blob. |
public synchronized void | append(char c) Appends one byte (in the form of a char) to the end of the Blob. |
public synchronized void | append(boolean addHighByte, char c) Appends one or two bytes (in the form of a char) to the end
of the Blob. |
public synchronized void | append(short s) Appends two bytes (in the form of a short) to the end of the Blob. |
public synchronized void | append(int i) Appends four bytes (in the form of an int) to the end of the Blob. |
public synchronized void | append(long l) Appends eight bytes (in the form of a long) to the end of the Blob. |
public synchronized void | append(float f) Appends four bytes (in the form of a float) to the end of the Blob. |
public synchronized void | append(double d) Appends eight bytes (in the form of a double) to the end of the Blob. |
public synchronized void | append(String s) Appends bytes from a String to the end of the Blob. |
public synchronized void | append(boolean addHighByte, String s) Appends bytes from a String to the end of the Blob. |
public synchronized void | append(byte arr) Appends an entire byte array to the end of the Blob. |
public synchronized void | append(byte arr, int startPos, int len) Appends a byte array to the end of the Blob. |
public synchronized void | append(Blob b) Appends the bytes from a Blob to the end of the Blob. |
protected void | appendNode(int newNodeSize) Appends a new node to the end of the internal list. |
protected synchronized void | beginEnumeration(int pos) Sets up an enumeration of the bytes of the Blob
starting from a particular point. |
final protected static boolean | between(char test, char low, char high) An inclusive between function (for chars).
Parameters: test - The char to test. Parameters: low - The lower bound. Parameters: high - The upper bound. |
final public static boolean | between(int test, int low, int high) An inclusive between function (for ints).
Parameters: test - The number to test. Parameters: low - The lower bound. Parameters: high - The upper bound. |
public synchronized byte | byteAt(int pos) Returns the byte at a specific location.
Parameters: pos - The position to from which to return the byte(0 -> beginning). |
public synchronized char | charAt(int pos) Returns a character reconstructed from one byte at a specific location.
Sets the high byte in the character to 0x0.
Parameters: pos - The position to get the byte to reconstuct the character(0 -> beginning). |
public synchronized char | charAt(boolean useHighByte, int pos) Returns a character reconstructed from one or two bytes at a
specific location.
Parameters: useHighByte - 'true' to use two bytes (one for the high byte)to reconstruct a character; 'false' to use one byte and set thehigh byte to 0x0. Parameters: pos - The position to get the byte(s) to reconstuct the character(0 -> beginning). |
public synchronized long | checksum() Generates and returns an 8-byte checksum. |
public synchronized Object | clone() Clones this Blob. |
public synchronized double | doubleAt(int pos) Returns a double precision floating point number reconstructed
from eight bytes at a specific
Parameters: pos - The position to get the bytes to reconstuct the double(0 -> beginning). |
public synchronized Enumeration | enumerateBytes(int pos) Returns an enumeration of the bytes in this Blob. |
public synchronized boolean | equals(Object o) Returns true if the blob is equal to the given object. |
protected BlobNode | findBefore(BlobNode target) Finds the node before the given node. |
protected synchronized float | floatAt(int pos) Returns a floating point number reconstructed from four bytes
at a specific
location.
Parameters: pos - The position to get the bytes to reconstuct the float(0 -> beginning). |
public synchronized Blob | getBlob(int pos, int len) Returns a new Blob drawn from bytes at a specific location.
Parameters: pos - The position to start retrieving the bytes to buildthe new Blob (0 -> beginning). Parameters: len - The number of bytes to put into the new Blob. |
public byte[] | getBytes() Gets the bytes of the blob as a byte array. |
public synchronized byte[] | getBytes(int start, int len) Returns a subset of the bytes of the blob as a byte array.
Parameters: start - start index to begin draw (included in get). Parameters: len - number of bytes to extract. |
public synchronized String | getString() Returns a String reconstructed from the bytes of the Blob. |
public synchronized String | getString(int pos, int len) Returns a String reconstructed from bytes at a specific location.
Sets the high byte in each character to 0x0.
Parameters: pos - The position to start retrieving the bytes to reconstuctthe String (0 -> beginning). Parameters: len - The length of the to-be-returned String. |
public synchronized String | getString(boolean useHighByte, int pos, int len) Returns a String reconstructed from bytes at a specific location.
Parameters: useHighByte - 'true' to use two bytes (one for the high byte)to reconstruct each character; 'false' to use one byte and set thehigh byte to 0x0. Parameters: pos - The position to start retrieving the bytes to reconstuctthe String (0 -> beginning). Parameters: len - The length of the to-be-returned String. |
protected synchronized boolean | hasMoreBytes() Returns 'true' if the Blob has more bytes, 'false' if empty. |
final public static char | hexDigit(int i) Returns the hex digit cooresponding to a number between 0 and 15.
Parameters: i - The number to get the hex digit for. |
public synchronized int | indexOf(byte b) Searches for a byte and returns an index to the first one found.
Parameters: b - The byte to search for. |
public synchronized int | indexOf(byte b, int pos) Searches for a byte and returns an index to the first one found.
Search starts at given index and includes that index.
Parameters: b - The byte to search for. Parameters: pos - The position to begin searching at (0 -> beginning). |
public InputStream | inputStream() |
public synchronized void | insertByte(int pos, byte b) Inserts a byte into the blob at the position pos. |
public synchronized void | insertBytes(int pos, byte arr) Inserts a byte into the blob at the position pos. |
public synchronized void | insertBytes(int pos, byte arr, int startPos, int len) Inserts a byte into the blob at the position pos. |
public synchronized int | intAt(int pos) Returns an int reconstructed from four bytes at a specific
location.
Parameters: pos - The position to get the bytes to reconstuct the int(0 -> beginning). |
public synchronized int | length() Gets the number of bytes in the Blob. |
public synchronized long | longAt(int pos) Returns a long int reconstructed from eight bytes at a specific
location.
Parameters: pos - The position to get the bytes to reconstuct the long(0 -> beginning). |
protected synchronized byte | nextByte() Returns the next byte in the Blob. |
public OutputStream | outputStream() |
public synchronized void | printContents() Prints the contents of this Blob. |
public synchronized int | read(int len, InputStream in) Reads bytes from an InputStream into the Blob.
Parameters: len - The number of bytes to attempt to read. Parameters: in - The InputStream to read from. |
public synchronized int | read(InputStream in) Reads all bytes from an InputStream into the Blob.
This will read an InputStream byte-by-byte until EOF and
append the data to the end of the Blob.
Parameters: in - The InputStream to read from. |
public synchronized int | readLimiting(InputStream in, long max) Reads most bytes from an InputStream into the Blob -
not to exceed bytes by much (it may read up to nodeSize more). |
protected void | readObject(ObjectInputStream in) A specialized object read routine. |
public synchronized void | removeByte(int pos) Removes a byte from the Blob at the requested position. |
public synchronized void | removeBytes(int pos, int len) Removes a number of bytes from the Blob at the requested position. |
protected int | seek(int pos) Seeks a position within the internal list.
Takes an offset from the beginning and sets the 'curr' pointer
to the reqested node and returns the offset within that node
to the correct position.
Parameters: pos - The position within the Blob to seek. |
public synchronized void | setByteAt(int pos, byte b) Sets a byte at a particular position. |
public synchronized short | shortAt(int pos) Returns a short int reconstructed from two bytes at a specific
location.
Parameters: pos - The position to get the bytes to reconstuct the short(0 -> beginning). |
final public static String | spaces(int n) Returns a string of a specified number of spaces.
Parameters: n - The number of spaces to create. |
final public static String | strstr(int n, char c) Returns a string of a specified number of a specified character.
Parameters: n - The number of characters to create in the return String. Parameters: c - The character to create. |
final public static String | toHex(byte b) Returns a hex representation of a byte.
Parameters: b - The byte to convert to hex. |
final public static String | toHex(short s) Returns the hex representation of a short.
Parameters: s - The short to convert to hex. |
final public static String | toHex(int i) Returns the hex representation of an int.
Parameters: i - The int to convert to hex. |
final public static String | toHex(long l) Returns the hex representation of an long.
Parameters: l - The long to convert to hex. |
final public static String | toHex(String s) Returns the hex representation of the characters of a String.
Parameters: s - The String to convert to hex. |
public synchronized String | toString() Returns a string representation of the Blob. |
public synchronized void | truncate(int len) Truncates the Blob to the specified position. |
public synchronized void | write(OutputStream out) Writes the entire contents of the Blob to an OutputStream. |
public synchronized void | write(int pos, int len, OutputStream out) Writes the contents of a part of the Blob to an OutputStream. |
protected void | writeObject(ObjectOutputStream out) A specialized object write routine.
This is because java gets a stack overflow error when
trying to write the linked list. |