org.apache.xindice.util
Class ByteBuffer
java.lang.Object
|
+--java.io.OutputStream
|
+--org.apache.xindice.util.ByteBuffer
- All Implemented Interfaces:
- java.io.Serializable
- public final class ByteBuffer
- extends java.io.OutputStream
- implements java.io.Serializable
ByteBuffer manages volatile arrays of bytes. It is implemented with
nearly the same method prototypes as StringBuffer except for the
setByteAt and byteAt methods which replace
StringBuffer's setCharAt and charAt methods.
ByteBuffer also extends the OutputStream abstract class and
functions like the ByteArrayOutputStream class.
getInputStream returns an InputStream instance for
streaming in the content of the ByteBuffer. Because none of the
methods in ByteBuffer are synchronized, it is the user's job to
properly synchronize calls to any of the methods of this class.
- See Also:
- Serialized Form
Method Summary |
void |
append(boolean value)
|
void |
append(byte value)
|
void |
append(byte[] value)
|
void |
append(ByteBuffer value)
|
void |
append(char value)
|
void |
append(char[] value)
|
void |
append(double value)
|
void |
append(float value)
|
void |
append(int value)
|
void |
append(long value)
|
void |
append(java.lang.Object value)
|
void |
append(java.lang.String value)
|
void |
append(java.lang.StringBuffer value)
|
byte |
byteAt(int index)
|
int |
capacity()
|
void |
chunkTo(java.io.OutputStream out)
|
void |
chunkTo(java.io.OutputStream out,
int chunkSize)
|
void |
delete(int pos,
int width)
|
void |
ensureCapacity(int size)
|
java.io.InputStream |
getInputStream()
|
void |
insert(boolean value,
int pos)
|
void |
insert(byte[] value,
int pos)
|
void |
insert(ByteBuffer value,
int pos)
|
void |
insert(byte value,
int pos)
|
void |
insert(char[] value,
int pos)
|
void |
insert(char value,
int pos)
|
void |
insert(double value,
int pos)
|
void |
insert(float value,
int pos)
|
void |
insert(int value,
int pos)
|
void |
insert(long value,
int pos)
|
void |
insert(java.lang.Object value,
int pos)
|
void |
insert(java.lang.StringBuffer value,
int pos)
|
void |
insert(java.lang.String value,
int pos)
|
boolean |
isLocked()
|
int |
length()
|
void |
lock()
|
void |
pack()
|
void |
readFrom(java.io.InputStream in)
|
void |
replace(boolean value,
int pos,
int width)
|
void |
replace(byte[] value,
int pos,
int width)
|
void |
replace(ByteBuffer value,
int pos,
int width)
|
void |
replace(char value,
int pos,
int width)
|
void |
replace(double value,
int pos,
int width)
|
void |
replace(float value,
int pos,
int width)
|
void |
replace(int value,
int pos,
int width)
|
void |
replace(long value,
int pos,
int width)
|
void |
replace(java.lang.Object value,
int pos,
int width)
|
void |
replace(java.lang.StringBuffer value,
int pos,
int width)
|
void |
replace(java.lang.String value,
int pos,
int width)
|
void |
reset()
|
void |
reverse()
|
void |
setByteAt(int index,
byte value)
|
void |
setLength(int value)
|
int |
size()
|
byte[] |
toByteArray()
|
java.lang.String |
toString()
|
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
void |
writeTo(java.io.OutputStream out)
|
Methods inherited from class java.io.OutputStream |
close, flush |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ByteBuffer
public ByteBuffer(int size)
ByteBuffer
public ByteBuffer(java.lang.String value)
ByteBuffer
public ByteBuffer(java.lang.StringBuffer value)
ByteBuffer
public ByteBuffer(byte[] value,
boolean copy)
ByteBuffer
public ByteBuffer(byte[] value)
ByteBuffer
public ByteBuffer()
capacity
public int capacity()
ensureCapacity
public void ensureCapacity(int size)
pack
public void pack()
append
public void append(byte[] value)
append
public void append(char[] value)
append
public void append(java.lang.String value)
append
public void append(java.lang.StringBuffer value)
append
public void append(ByteBuffer value)
append
public void append(boolean value)
append
public void append(char value)
append
public void append(byte value)
append
public void append(double value)
append
public void append(float value)
append
public void append(int value)
append
public void append(long value)
append
public void append(java.lang.Object value)
insert
public void insert(byte[] value,
int pos)
insert
public void insert(char[] value,
int pos)
insert
public void insert(java.lang.String value,
int pos)
insert
public void insert(java.lang.StringBuffer value,
int pos)
insert
public void insert(ByteBuffer value,
int pos)
insert
public void insert(boolean value,
int pos)
insert
public void insert(char value,
int pos)
insert
public void insert(byte value,
int pos)
insert
public void insert(double value,
int pos)
insert
public void insert(float value,
int pos)
insert
public void insert(int value,
int pos)
insert
public void insert(long value,
int pos)
insert
public void insert(java.lang.Object value,
int pos)
delete
public void delete(int pos,
int width)
replace
public void replace(byte[] value,
int pos,
int width)
replace
public void replace(java.lang.String value,
int pos,
int width)
replace
public void replace(java.lang.StringBuffer value,
int pos,
int width)
replace
public void replace(ByteBuffer value,
int pos,
int width)
replace
public void replace(boolean value,
int pos,
int width)
replace
public void replace(char value,
int pos,
int width)
replace
public void replace(double value,
int pos,
int width)
replace
public void replace(float value,
int pos,
int width)
replace
public void replace(int value,
int pos,
int width)
replace
public void replace(long value,
int pos,
int width)
replace
public void replace(java.lang.Object value,
int pos,
int width)
toByteArray
public byte[] toByteArray()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
length
public int length()
setLength
public void setLength(int value)
size
public int size()
reset
public void reset()
byteAt
public byte byteAt(int index)
setByteAt
public void setByteAt(int index,
byte value)
reverse
public void reverse()
getInputStream
public java.io.InputStream getInputStream()
writeTo
public void writeTo(java.io.OutputStream out)
throws java.io.IOException
chunkTo
public void chunkTo(java.io.OutputStream out,
int chunkSize)
throws java.io.IOException
chunkTo
public void chunkTo(java.io.OutputStream out)
throws java.io.IOException
readFrom
public void readFrom(java.io.InputStream in)
throws java.io.IOException
write
public void write(int b)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
write
public void write(byte[] b)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
lock
public void lock()
isLocked
public boolean isLocked()
Copyright (c) 1999-2001 The Apache Software Foundation