Mark and Reset

Like input streams, buffers can be marked and reset using the mark( ) and reset( ) methods:

public final Buffer mark( )
public final Buffer reset( ) throws InvalidMarkException

Initially, the mark is unset. Invoking the buffer's mark( ) method places the mark at the buffer's current position. Resetting returns the position to the previous mark. Unlike with InputStream, there's no markSupported( ) method. All buffers support marking and resetting.

The mark is always less than or equal to the position and the limit. If either the limit or the position is set to a value less than the current mark, the mark is cleared. Resetting when there's no mark throws an InvalidMarkException.

Basic I/O

Introducing I/O

Output Streams

Input Streams

Data Sources

File Streams

Network Streams

Filter Streams

Filter Streams

Print Streams

Data Streams

Streams in Memory

Compressing Streams

JAR Archives

Cryptographic Streams

Object Serialization

New I/O



Nonblocking I/O

The File System

Working with Files

File Dialogs and Choosers


Character Sets and Unicode

Readers and Writers

Formatted I/O with java.text


The Java Communications API


The J2ME Generic Connection Framework


Character Sets

Java I/O
Java I/O
ISBN: 0596527500
EAN: 2147483647
Year: 2004
Pages: 244 © 2008-2020.
If you may any questions please contact us: