| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private static final Field | |
| private final ByteArrayInputStream | |
| private final int | |
| private static final Field | |
| private static final Field | |
| private int | |
| pack-priv static final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static Field | |
| private static int | |
| protected void | implCloseChannel()
Implements abstract java. Closes this channel. |
| private static int | |
| private static int | |
| public long | position()
Implements java. Returns this channel's position. |
| public synchronized SeekableByteChannel | position(long
The new position, a non-negative integer counting
the number of bytes from the beginning of the entity newPosition)Implements java. Sets this channel's position. |
| public synchronized int | read(ByteBuffer
The buffer into which bytes are to be transferred target)Implements java. Reads a sequence of bytes from this channel into the given buffer. |
| private static int | |
| public long | size()
Implements java. Returns the current size of entity to which this channel is connected. |
| public SeekableByteChannel | truncate(long
The new size, a non-negative byte count size)Implements java. Truncates the entity, to which this channel is connected, to the given size. |
| public int | write(ByteBuffer
The buffer from which bytes are to be retrieved src)Implements java. Writes a sequence of bytes to this channel from the given buffer. |
| count | back to summary |
|---|---|
| private final int count | |
| countField | back to summary |
|---|---|
| private static final Field countField | |
| in | back to summary |
|---|---|
| private final ByteArrayInputStream in | |
| mark | back to summary |
|---|---|
| private final int mark | |
| markField | back to summary |
|---|---|
| private static final Field markField | |
| posField | back to summary |
|---|---|
| private static final Field posField | |
| truncatedBy | back to summary |
|---|---|
| private int truncatedBy | |
| USABLE | back to summary |
|---|---|
| pack-priv static final boolean USABLE | |
| SeekableByteChannelImpl | back to summary |
|---|---|
| pack-priv SeekableByteChannelImpl(ByteArrayInputStream in) | |
| accessibleField | back to summary |
|---|---|
| private static Field accessibleField(final String name) | |
| count | back to summary |
|---|---|
| private static int count(ByteArrayInputStream in) | |
| implCloseChannel | back to summary |
|---|---|
| protected void implCloseChannel() throws IOException Implements abstract java. Doc from java. Closes this channel. This method is invoked by the An implementation of this method must arrange for any other thread that is blocked in an I/O operation upon this channel to return immediately, either by throwing an exception or by returning normally.
| |
| mark | back to summary |
|---|---|
| private static int mark(ByteArrayInputStream in) | |
| pos | back to summary |
|---|---|
| private static int pos(ByteArrayInputStream in) | |
| position | back to summary |
|---|---|
| public long position() Implements java. Doc from java. Returns this channel's position.
| |
| position | back to summary |
|---|---|
| public synchronized SeekableByteChannel position(long newPosition) throws IOException Implements java. Doc from java. Sets this channel's position. Setting the position to a value that is greater than the current size is legal but does not change the size of the entity. A later attempt to read bytes at such a position will immediately return an end-of-file indication. A later attempt to write bytes at such a position will cause the entity to grow to accommodate the new bytes; the values of any bytes between the previous end-of-file and the newly-written bytes are unspecified. Setting the channel's position is not recommended when connected to
an entity, typically a file, that is opened with the
| |
| read | back to summary |
|---|---|
| public synchronized int read(ByteBuffer target) throws IOException Implements java. Doc from java. Reads a sequence of bytes from this channel into the given buffer. An attempt is made to read up to r bytes from the channel,
where r is the number of bytes remaining in the buffer, that is,
Suppose that a byte sequence of length n is read, where
A read operation might not fill the buffer, and in fact it might not read any bytes at all. Whether or not it does so depends upon the nature and state of the channel. A socket channel in non-blocking mode, for example, cannot read any more bytes than are immediately available from the socket's input buffer; similarly, a file channel cannot read any more bytes than remain in the file. It is guaranteed, however, that if a channel is in blocking mode and there is at least one byte remaining in the buffer then this method will block until at least one byte is read. This method may be invoked at any time. If another thread has already initiated a read operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| readIntField | back to summary |
|---|---|
| private static int readIntField(ByteArrayInputStream self, Field field) | |
| size | back to summary |
|---|---|
| public long size() Implements java. Doc from java. Returns the current size of entity to which this channel is connected.
| |
| truncate | back to summary |
|---|---|
| public SeekableByteChannel truncate(long size) throws IOException Implements java. Doc from java. Truncates the entity, to which this channel is connected, to the given size. If the given size is less than the current size then the entity is truncated, discarding any bytes beyond the new end. If the given size is greater than or equal to the current size then the entity is not modified. In either case, if the current position is greater than the given size then it is set to that size. An implementation of this interface may prohibit truncation when
connected to an entity, typically a file, opened with the
| |
| write | back to summary |
|---|---|
| public int write(ByteBuffer src) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffer. Bytes are written starting at this channel's current position, unless
the channel is connected to an entity such as a file that is opened with
the
| |