< prev index next >
src/java.corba/share/classes/com/sun/corba/se/impl/ior/ByteBuffer.java
Print this page
*** 35,47 ****
* Any array elements following the last element in the ByteBuffer are 0.
*/
protected byte elementData[];
/**
! * The number of valid components in this <tt>ByteBuffer</tt> object.
! * Components <tt>elementData[0]</tt> through
! * <tt>elementData[elementCount-1]</tt> are the actual items.
*
* @serial
*/
protected int elementCount;
--- 35,47 ----
* Any array elements following the last element in the ByteBuffer are 0.
*/
protected byte elementData[];
/**
! * The number of valid components in this {@code ByteBuffer} object.
! * Components {@code elementData[0]} through
! * {@code elementData[elementCount-1]} are the actual items.
*
* @serial
*/
protected int elementCount;
*** 86,107 ****
this(initialCapacity, 0);
}
/**
* Constructs an empty ByteBuffer so that its internal data array
! * has size <tt>10</tt> and its standard capacity increment is
* zero.
*/
public ByteBuffer() {
this(200);
}
/**
* Trims the capacity of this ByteBuffer to be the ByteBuffer's current
* size. If the capacity of this cector is larger than its current
* size, then the capacity is changed to equal the size by replacing
! * its internal data array, kept in the field <tt>elementData</tt>,
* with a smaller one. An application can use this operation to
* minimize the storage of a ByteBuffer.
*/
public void trimToSize() {
int oldCapacity = elementData.length;
--- 86,107 ----
this(initialCapacity, 0);
}
/**
* Constructs an empty ByteBuffer so that its internal data array
! * has size {@code 10} and its standard capacity increment is
* zero.
*/
public ByteBuffer() {
this(200);
}
/**
* Trims the capacity of this ByteBuffer to be the ByteBuffer's current
* size. If the capacity of this cector is larger than its current
* size, then the capacity is changed to equal the size by replacing
! * its internal data array, kept in the field {@code elementData},
* with a smaller one. An application can use this operation to
* minimize the storage of a ByteBuffer.
*/
public void trimToSize() {
int oldCapacity = elementData.length;
*** 136,146 ****
/**
* Returns the current capacity of this ByteBuffer.
*
* @return the current capacity (the length of its internal
! * data arary, kept in the field <tt>elementData</tt>
* of this ByteBuffer.
*/
public int capacity() {
return elementData.length;
}
--- 136,146 ----
/**
* Returns the current capacity of this ByteBuffer.
*
* @return the current capacity (the length of its internal
! * data arary, kept in the field {@code elementData}
* of this ByteBuffer.
*/
public int capacity() {
return elementData.length;
}
*** 155,167 ****
}
/**
* Tests if this ByteBuffer has no components.
*
! * @return <code>true</code> if and only if this ByteBuffer has
* no components, that is, its size is zero;
! * <code>false</code> otherwise.
*/
public boolean isEmpty() {
return elementCount == 0;
}
--- 155,167 ----
}
/**
* Tests if this ByteBuffer has no components.
*
! * @return {@code true} if and only if this ByteBuffer has
* no components, that is, its size is zero;
! * {@code false} otherwise.
*/
public boolean isEmpty() {
return elementCount == 0;
}
< prev index next >