| it.stefanochizzolini.clown.bytes.IBuffer
All known Subclasses: it.stefanochizzolini.clown.bytes.Buffer,
IBuffer | public interface IBuffer extends IInputStream(Code) | | Buffer interface.
Its pivotal concept is the array index.
|
Method Summary | |
void | append(byte data) Appends a byte to the buffer. | void | append(byte[] data) Appends a byte array to the buffer. | void | append(byte[] data, int offset, int length) Appends a byte range to the buffer. | void | append(String data) Appends a string to the buffer. | void | append(IInputStream data) Appends an IInputStream to the buffer. | IBuffer | clone() Gets a clone of the buffer. | void | decode(Filter filter) Applies the specified filter to decode the buffer. | void | delete(int index, int length) Deletes a byte chunk from the buffer. | byte[] | encode(Filter filter) Applies the specified filter to encode the buffer.
Parameters: filter - Filter to use for encoding the buffer. | int | getByte(int index) Gets the byte at a specified location.
Parameters: index - A location in the buffer. | byte[] | getByteArray(int index, int length) Gets the byte range beginning at a specified location.
Parameters: index - Location at which the byte range has to begin. Parameters: length - Number of bytes to copy. | int | getCapacity() Gets the allocated buffer size. | String | getString(int index, int length) Gets the string beginning at a specified location.
Parameters: index - Location at which the string has to begin. Parameters: length - Number of bytes to convert. | void | insert(int index, byte[] data) Inserts a byte array into the buffer. | void | insert(int index, byte[] data, int offset, int length) Inserts a byte range into the buffer. | void | insert(int index, String data) Inserts a string into the buffer. | void | insert(int index, IInputStream data) Inserts an IInputStream into the buffer. | void | replace(int index, byte[] data) Replaces the buffer contents with a byte array. | void | replace(int index, byte[] data, int offset, int length) Replaces the buffer contents with a byte range. | void | replace(int index, String data) Replaces the buffer contents with a string. | void | replace(int index, IInputStream data) Replaces the buffer contents with an IInputStream. | void | setLength(int value) Sets the used buffer size. | void | writeTo(IOutputStream stream) Writes the buffer data to a stream. |
append | void append(byte data)(Code) | | Appends a byte to the buffer.
Parameters: data - Byte to copy. |
append | void append(byte[] data)(Code) | | Appends a byte array to the buffer.
Parameters: data - Byte array to copy. |
append | void append(byte[] data, int offset, int length)(Code) | | Appends a byte range to the buffer.
Parameters: data - Byte array from which the byte range has to be copied. Parameters: offset - Location in the byte array at which copying begins. Parameters: length - Number of bytes to copy. |
append | void append(String data)(Code) | | Appends a string to the buffer.
Parameters: data - String to copy. |
append | void append(IInputStream data)(Code) | | Appends an IInputStream to the buffer.
Parameters: data - Source data to copy. |
clone | IBuffer clone()(Code) | | Gets a clone of the buffer.
Deep copy of the buffer. |
decode | void decode(Filter filter)(Code) | | Applies the specified filter to decode the buffer.
Parameters: filter - Filter to use for decoding the buffer. |
delete | void delete(int index, int length)(Code) | | Deletes a byte chunk from the buffer.
Parameters: index - Location at which deletion has to begin. Parameters: length - Number of bytes to delete. |
encode | byte[] encode(Filter filter)(Code) | | Applies the specified filter to encode the buffer.
Parameters: filter - Filter to use for encoding the buffer. Encoded buffer. |
getByte | int getByte(int index)(Code) | | Gets the byte at a specified location.
Parameters: index - A location in the buffer. Byte at the specified location. |
getByteArray | byte[] getByteArray(int index, int length)(Code) | | Gets the byte range beginning at a specified location.
Parameters: index - Location at which the byte range has to begin. Parameters: length - Number of bytes to copy. Byte range beginning at the specified location. |
getCapacity | int getCapacity()(Code) | | Gets the allocated buffer size.
Allocated buffer size. |
getString | String getString(int index, int length)(Code) | | Gets the string beginning at a specified location.
Parameters: index - Location at which the string has to begin. Parameters: length - Number of bytes to convert. String beginning at the specified location. |
insert | void insert(int index, byte[] data)(Code) | | Inserts a byte array into the buffer.
Parameters: index - Location at which the byte array has to be inserted. Parameters: data - Byte array to insert. |
insert | void insert(int index, byte[] data, int offset, int length)(Code) | | Inserts a byte range into the buffer.
Parameters: index - Location at which the byte range has to be inserted. Parameters: data - Byte array from which the byte range has to be copied. Parameters: offset - Location in the byte array at which copying begins. Parameters: length - Number of bytes to copy. |
insert | void insert(int index, String data)(Code) | | Inserts a string into the buffer.
Parameters: index - Location at which the string has to be inserted. Parameters: data - String to insert. |
insert | void insert(int index, IInputStream data)(Code) | | Inserts an IInputStream into the buffer.
Parameters: index - Location at which the IInputStream has to be inserted. Parameters: data - Source data to copy. |
replace | void replace(int index, byte[] data)(Code) | | Replaces the buffer contents with a byte array.
Parameters: index - Location at which the byte array has to be copied. Parameters: data - Byte array to copy. |
replace | void replace(int index, byte[] data, int offset, int length)(Code) | | Replaces the buffer contents with a byte range.
Parameters: index - Location at which the byte range has to be copied. Parameters: data - Byte array from which the byte range has to be copied. Parameters: offset - Location in the byte array at which copying begins. Parameters: length - Number of bytes to copy. |
replace | void replace(int index, String data)(Code) | | Replaces the buffer contents with a string.
Parameters: index - Location at which the string has to be copied. Parameters: data - String to copy. |
replace | void replace(int index, IInputStream data)(Code) | | Replaces the buffer contents with an IInputStream.
Parameters: index - Location at which the IInputStream has to be copied. Parameters: data - Source data to copy. |
setLength | void setLength(int value)(Code) | | Sets the used buffer size.
Parameters: value - New length. |
writeTo | void writeTo(IOutputStream stream)(Code) | | Writes the buffer data to a stream.
Parameters: stream - Target stream. |
|
|