Top Description Methods
org.apache.derby.iapi.services.io

public Interface Limit

Known Direct Subinterfaces
org.apache.derby.iapi.services.io.LimitObjectInput
Known Direct Implementers
org.apache.derby.iapi.services.io.LimitInputStream, org.apache.derby.iapi.services.io.LimitReader, org.apache.derby.iapi.services.io.ArrayOutputStream, org.apache.derby.iapi.services.io.CounterOutputStream
Imports
java.io.IOException

Methods that allow limits to be placed on an input or output stream to avoid clients reading or writing too much information.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of bytes within the limit that have not been read or written.
clearLimit
()

Clear any limit set by setLimit.

public void
setLimit(int
The length to set
length
)

Set the limit of the data that can be read or written.

Method Detail

clearLimitback to summary
public int clearLimit()

Clear any limit set by setLimit. After this call no limit checking will be made on any read until a setLimit()) call is made.

Returns:int

the number of bytes within the limit that have not been read or written.

setLimitback to summary
public void setLimit(int length) throws IOException

Set the limit of the data that can be read or written. After this call up to and including length bytes can be read from or skipped in the stream.

On input classes (e.g. InputStreams) any attempt to read or skip beyond the limit will result in an end of file indication (e.g. read() methods returning -1 or throwing EOFException).

On output classes (e.g. OutputStream) any attempt to write more beyond the limit will result in an EOFException

Parameters
length:int

The length to set

Exceptions
IOException:
IOException from some underlying stream
EOFException:
The set limit would exceed the available data in the stream.