java.lang.Objectjava.io.Reader
java.io.FilterReader
java.io.PushbackReader
public class PushbackReader
A character-stream reader that allows characters to be pushed back into the stream.
| Field Summary |
|---|
| Fields inherited from class java.io.FilterReader |
|---|
in |
| Fields inherited from class java.io.Reader |
|---|
lock |
| Constructor Summary | |
|---|---|
PushbackReader(Reader in)
Create a new pushback reader with a one-character pushback buffer. |
|
PushbackReader(Reader in,
int size)
Create a new pushback reader with a pushback buffer of the given size. |
|
| Method Summary | |
|---|---|
void |
close()
Close the stream. |
void |
mark(int readAheadLimit)
Mark the present position in the stream. |
boolean |
markSupported()
Tell whether this stream supports the mark() operation, which it does not. |
int |
read()
Read a single character. |
int |
read(char[] cbuf,
int off,
int len)
Read characters into a portion of an array. |
boolean |
ready()
Tell whether this stream is ready to be read. |
void |
reset()
Reset the stream. |
long |
skip(long n)
Skip characters. |
void |
unread(char[] cbuf)
Push back an array of characters by copying it to the front of the pushback buffer. |
void |
unread(char[] cbuf,
int off,
int len)
Push back a portion of an array of characters by copying it to the front of the pushback buffer. |
void |
unread(int c)
Push back a single character. |
| Methods inherited from class java.io.Reader |
|---|
read, read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PushbackReader(Reader in, int size)
in - The reader from which characters will be readsize - The size of the pushback buffer
IllegalArgumentException - if size is <= 0public PushbackReader(Reader in)
in - The reader from which characters will be read| Method Detail |
|---|
public int read()
throws IOException
read in class FilterReaderIOException - If an I/O error occurs
public int read(char[] cbuf,
int off,
int len)
throws IOException
read in class FilterReadercbuf - Destination bufferoff - Offset at which to start writing characterslen - Maximum number of characters to read
IOException - If an I/O error occurs
public void unread(int c)
throws IOException
c - The character to push back
IOException - If the pushback buffer is full,
or if some other I/O error occurs
public void unread(char[] cbuf,
int off,
int len)
throws IOException
cbuf[off], the
character after that will have the value cbuf[off+1], and
so forth.
cbuf - Character arrayoff - Offset of first character to push backlen - Number of characters to push back
IOException - If there is insufficient room in the pushback
buffer, or if some other I/O error occurs
public void unread(char[] cbuf)
throws IOException
cbuf[0], the character after that
will have the value cbuf[1], and so forth.
cbuf - Character array to push back
IOException - If there is insufficient room in the pushback
buffer, or if some other I/O error occurs
public boolean ready()
throws IOException
ready in class FilterReaderIOException - If an I/O error occurs
public void mark(int readAheadLimit)
throws IOException
mark
for class PushbackReader always throws an exception.
mark in class FilterReaderreadAheadLimit - Limit on the number of characters that may be
read while still preserving the mark. After
reading this many characters, attempting to
reset the stream may fail.
IOException - Always, since mark is not supported
public void reset()
throws IOException
reset method of
PushbackReader always throws an exception.
reset in class FilterReaderIOException - Always, since reset is not supportedpublic boolean markSupported()
markSupported in class FilterReader
public void close()
throws IOException
close in interface Closeableclose in class FilterReaderIOException - If an I/O error occurs
public long skip(long n)
throws IOException
skip in class FilterReadern - The number of characters to skip
IllegalArgumentException - If n is negative.
IOException - If an I/O error occursCes informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
6 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)