java.lang.Objectjava.io.OutputStream
java.io.PipedOutputStream
public class PipedOutputStream
A piped output stream can be connected to a piped input stream
to create a communications pipe. The piped output stream is the
sending end of the pipe. Typically, data is written to a
PipedOutputStream object by one thread and data is
read from the connected PipedInputStream by some
other thread. Attempting to use both objects from a single thread
is not recommended as it may deadlock the thread.
PipedInputStream| Constructor Summary | |
|---|---|
PipedOutputStream()
Creates a piped output stream that is not yet connected to a piped input stream. |
|
PipedOutputStream(PipedInputStream snk)
Creates a piped output stream connected to the specified piped input stream. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this piped output stream and releases any system resources associated with this stream. |
void |
connect(PipedInputStream snk)
Connects this piped output stream to a receiver. |
void |
flush()
Flushes this output stream and forces any buffered output bytes to be written out. |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array
starting at offset off to this piped output stream. |
void |
write(int b)
Writes the specified byte to the piped output stream. |
| Methods inherited from class java.io.OutputStream |
|---|
write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PipedOutputStream(PipedInputStream snk) throws IOException
snk.
snk - The piped input stream to connect to.
IOException - if an I/O error occurs.public PipedOutputStream()
| Method Detail |
|---|
public void connect(PipedInputStream snk) throws IOException
IOException is thrown.
If snk is an unconnected piped input stream and
src is an unconnected piped output stream, they may
be connected by either the call:
or the call:
src.connect(snk)
The two calls have the same effect.
snk.connect(src)
snk - the piped input stream to connect to.
IOException - if an I/O error occurs.
public void write(int b)
throws IOException
byte to the piped output stream.
If a thread was reading data bytes from the connected piped input
stream, but the thread is no longer alive, then an
IOException is thrown.
Implements the write method of OutputStream.
write in class OutputStreamb - the byte to be written.
IOException - if an I/O error occurs.
public void write(byte[] b,
int off,
int len)
throws IOException
len bytes from the specified byte array
starting at offset off to this piped output stream.
If a thread was reading data bytes from the connected piped input
stream, but the thread is no longer alive, then an
IOException is thrown.
write in class OutputStreamb - the data.off - the start offset in the data.len - the number of bytes to write.
IOException - if an I/O error occurs.
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOException - if an I/O error occurs.
public void close()
throws IOException
close in interface Closeableclose in class OutputStreamIOException - if an I/O error occurs.Ces 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)