|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
schmitzm.io.InputBuffer
public class InputBuffer
Field Summary | |
---|---|
protected byte[] |
buffer
|
protected boolean |
bufferFull
|
protected int |
readPos
|
protected int |
writePos
|
Constructor Summary | |
---|---|
InputBuffer(int byteSize)
Erzeugt einen neuen InputBuffer . |
Method Summary | |
---|---|
int |
available()
Liefert die Anzahl an Bytes, die (noch) aus dem Buffer gelesen werden koennen. |
int |
availableSpace()
Liefert die Anzahl an Bytes, die (noch) in den Buffer geschrieben werden koennen. |
long |
clear()
Leert den Buffer. |
int |
getBufferSize()
|
byte[] |
getContent()
Liefert den aktuellen Inhalt des Buffers als bytes -Array. |
protected int |
incPosition(int pos)
Erhoeht die Zeiger-Position im Buffer. |
protected int |
incPosition(int pos,
int hop)
Erhoeht die Zeiger-Position im Buffer. |
int |
read()
Liesst das naechste Byte aus dem Buffer. |
long |
skip(long n)
Entfernt eine Anzahl von Bytes aus dem Buffer. |
void |
write(byte b)
Schreibt ein Byte in den Buffer. |
void |
write(byte[] bytes)
Schreibt eine Reihe von Bytes in den Buffer. |
void |
write(InputStream input,
int len)
Schreibt eine Reihe von Bytes in den Buffer. |
Methods inherited from class java.io.InputStream |
---|
close, mark, markSupported, read, read, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected byte[] buffer
protected int readPos
protected int writePos
protected boolean bufferFull
Constructor Detail |
---|
public InputBuffer(int byteSize)
InputBuffer
.
byteSize
- Groesse des Buffers in ByteMethod Detail |
---|
public int getBufferSize()
protected int incPosition(int pos)
protected int incPosition(int pos, int hop)
pos
- aktuelle Zeiger-Positionhop
- Anzahl an Positionen, die vor gerueckt werden sollenpublic void write(byte b)
b
- ein Byte
BufferOverflowException
- falls der Buffer bereits voll istpublic void write(byte[] bytes)
bytes
- Menge von zu schreibenen Bytes
BufferOverflowException
- falls der Buffer bereits voll istpublic void write(InputStream input, int len) throws IOException
input
- Stream aus dem die Bytes gelesen werdenlen
- Anzahl zu lesender Bytes
BufferOverflowException
- falls nicht genuegend freier
Platz im Buffer ist
IOException
- falls das Lesen aus dem Eingabe-Stream
scheitertpublic int availableSpace()
public int read() throws IOException
read
in class InputStream
IOException
public int available()
available
in class InputStream
public long skip(long n)
skip
in class InputStream
n
- Anzahl zu entfernender Bytes (muss ein int
sein)
public long clear()
public byte[] getContent()
bytes
-Array.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |