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

public Class BlockedByteArrayOutputStream

extends OutputStream
Class Inheritance
Imports
java.io.OutputStream

Output stream writing bytes into an underlying blocked byte array.

Field Summary

Modifier and TypeField and Description
private long
pos

The current position of the stream.

private BlockedByteArray
src

The underlying destination.

Constructor Summary

AccessConstructor and Description
public
BlockedByteArrayOutputStream(BlockedByteArray
the underlying blocked byte array
src
,
long
the initial position of stream
pos
)

Creates a new stream writing data into the specified blocked byte array.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Closes the stream.

pack-priv long

Returns:

The current byte position.
getPosition
()

Returns the current position.

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

Sets the position.

public void
write(int
the byte to write
b
)

Implements abstract java.io.OutputStream.write.

Writes the single byte into the underlying blocked byte array.

public void
write(byte[]
source byte array
buf
,
int
index of the first byte to write
offset
,
int
the number of bytes to write
len
)

Overrides java.io.OutputStream.write.

Writes the specified bytes into the underlying blocked byte array.

Inherited from java.io.OutputStream:
flushnullOutputStreamwrite

Field Detail

posback to summary
private long pos

The current position of the stream.

srcback to summary
private BlockedByteArray src

The underlying destination. Set to null when closed.

Constructor Detail

BlockedByteArrayOutputStreamback to summary
public BlockedByteArrayOutputStream(BlockedByteArray src, long pos)

Creates a new stream writing data into the specified blocked byte array.

Parameters
src:BlockedByteArray

the underlying blocked byte array

pos:long

the initial position of stream

Method Detail

closeback to summary
public void close()

Overrides java.io.OutputStream.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.

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

Sets the position.

Parameters
newPos:long

the new byte position

writeback to summary
public void write(int b)

Implements abstract java.io.OutputStream.write.

Writes the single byte into the underlying blocked byte array.

Parameters
b:int

the byte to write

writeback to summary
public void write(byte[] buf, int offset, int len)

Overrides java.io.OutputStream.write.

Writes the specified bytes into the underlying blocked byte array.

Parameters
buf:byte[]

source byte array

offset:int

index of the first byte to write

len:int

the number of bytes to write