Top Description Fields Constructors Methods
org.apache.derby.impl.io.vfmem

pack-priv Class BlockedByteArrayInputStream

extends InputStream
Class Inheritance
Imports
java.io.InputStream

An input stream reading from a blocked byte array.

Field Summary

Modifier and TypeField and Description
private long
pos

The current position of the stream.

private BlockedByteArray
src

The underlying source.

Constructor Summary

AccessConstructor and Description
public
BlockedByteArrayInputStream(BlockedByteArray
the source blocked byte array
src
,
long
the initial position to start reading from
pos
)

Creates a new input stream reading from a blocked byte array.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Closes the stream.

pack-priv long

Returns:

The current byte position.
getPosition
()

Returns the current position.

public int

Returns:

A byte.
read
()

Implements abstract java.io.InputStream.read.

Reads a single byte.

public int

Returns:

The number of bytes read.
read
(byte[]
destination buffer
buf
,
int
offset into the destination buffer
offset
,
int
number of bytes to read
len
)

Overrides java.io.InputStream.read.

Reads up to len bytes.

pack-priv void
setPosition(long
the new byte position
newPos
)

Sets the position.

Inherited from java.io.InputStream:
availablemarkmarkSupportednullInputStreamreadreadAllBytesreadNBytesreadNBytesresetskipskipNBytestransferTo

Field Detail

posback to summary
private long pos

The current position of the stream.

srcback to summary
private BlockedByteArray src

The underlying source. Set to null when closed.

Constructor Detail

BlockedByteArrayInputStreamback to summary
public BlockedByteArrayInputStream(BlockedByteArray src, long pos)

Creates a new input stream reading from a blocked byte array.

Parameters
src:BlockedByteArray

the source blocked byte array

pos:long

the initial position to start reading from

Method Detail

closeback to summary
public void close()

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Closes the stream.

getPositionback to summary
pack-priv long getPosition()

Returns the current position.

Returns:long

The current byte position.

readback to summary
public int read()

Implements abstract java.io.InputStream.read.

Reads a single byte.

Returns:int

A byte.

readback to summary
public int read(byte[] buf, int offset, int len)

Overrides java.io.InputStream.read.

Reads up to len bytes.

Parameters
buf:byte[]

destination buffer

offset:int

offset into the destination buffer

len:int

number of bytes to read

Returns:int

The number of bytes read.

setPositionback to summary
pack-priv void setPosition(long newPos)

Sets the position.

Parameters
newPos:long

the new byte position