|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
com.sun.cdc.io.GeneralBase
public abstract class GeneralBase
Base class for objects that implement the DataInput and DataOutput interfaces. It also behaves like a DataOutputStream so it can be used for UniversalOutputStream
| Field Summary |
|---|
| Fields inherited from class java.io.DataOutputStream |
|---|
written |
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
GeneralBase()
|
|
| Method Summary | |
|---|---|
void |
close()
Close the stream. |
void |
flush()
Flush the stream. |
int |
read()
Reads the next byte of data from the input stream. |
boolean |
readBoolean()
See the general contract of the readBoolean
method of DataInput. |
byte |
readByte()
See the general contract of the readByte
method of DataInput. |
char |
readChar()
See the general contract of the readChar
method of DataInput. |
double |
readDouble()
Unsupported function |
float |
readFloat()
Unsupported function |
void |
readFully(byte[] b)
See the general contract of the readFully
method of DataInput. |
void |
readFully(byte[] b,
int off,
int len)
See the general contract of the readFully
method of DataInput. |
int |
readInt()
See the general contract of the readInt
method of DataInput. |
String |
readLine()
Unsupported function |
long |
readLong()
See the general contract of the readLong
method of DataInput. |
short |
readShort()
See the general contract of the readShort
method of DataInput. |
int |
readUnsignedByte()
See the general contract of the readUnsignedByte
method of DataInput. |
int |
readUnsignedShort()
See the general contract of the readUnsignedShort
method of DataInput. |
String |
readUTF()
See the general contract of the readUTF
method of DataInput. |
long |
skip(long n)
Skips over and discards n bytes of data from this input
stream. |
int |
skipBytes(int n)
See the general contract of the skipBytes
method of DataInput. |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array
starting at offset off to the underlying output stream. |
void |
write(int b)
Writes the specified byte (the low eight bits of the argument b) to the underlying output stream. |
| Methods inherited from class java.io.DataOutputStream |
|---|
size, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
| Methods inherited from class java.io.FilterOutputStream |
|---|
write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.io.DataOutput |
|---|
write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
| Constructor Detail |
|---|
public GeneralBase()
| Method Detail |
|---|
public void write(int b)
throws IOException
b) to the underlying output stream. If no exception
is thrown, the counter written is incremented by
1.
Implements the write method of OutputStream.
write in interface DataOutputwrite in class DataOutputStreamb - the byte to be written.
IOException - if an I/O error occurs.FilterOutputStream.out
public void write(byte[] b,
int off,
int len)
throws IOException
len bytes from the specified byte array
starting at offset off to the underlying output stream.
If no exception is thrown, the counter written is
incremented by len.
write in interface DataOutputwrite in class DataOutputStreamb - the data.off - the start offset in the data.len - the number of bytes to write.
IOException - if an I/O error occurs.FilterOutputStream.out
public void flush()
throws IOException
flush in class DataOutputStreamIOException - if an I/O error occurs.FilterOutputStream.out,
OutputStream.flush()
public void close()
throws IOException
close in class FilterOutputStreamIOException - if an I/O error occurs.FilterOutputStream.flush(),
FilterOutputStream.out
public int read()
throws IOException
int in the range 0 to
255. If no byte is available because the end of the stream
has been reached, the value -1 is returned. This method
blocks until input data is available, the end of the stream is detected,
or an exception is thrown.
A subclass must provide an implementation of this method.
-1 if the end of the
stream is reached.
IOException - if an I/O error occurs.
public long skip(long n)
throws IOException
n bytes of data from this input
stream. The skip method may, for a variety of reasons, end
up skipping over some smaller number of bytes, possibly 0.
This may result from any of a number of conditions; reaching end of file
before n bytes have been skipped is only one possibility.
The actual number of bytes skipped is returned. If n is
negative, no bytes are skipped.
The skip method of InputStream creates a
byte array and then repeatedly reads into it until n bytes
have been read or the end of the stream has been reached. Subclasses are
encouraged to provide a more efficient implementation of this method.
n - the number of bytes to be skipped.
IOException - if an I/O error occurs.
public void readFully(byte[] b)
throws IOException
readFully
method of DataInput.
Bytes for this operation are read from the contained input stream.
readFully in interface DataInputb - the buffer into which the data is read.
EOFException - if this input stream reaches the end before
reading all the bytes.
IOException - if an I/O error occurs.
public void readFully(byte[] b,
int off,
int len)
throws IOException
readFully
method of DataInput.
Bytes for this operation are read from the contained input stream.
readFully in interface DataInputb - the buffer into which the data is read.off - the start offset of the data.len - the number of bytes to read.
EOFException - if this input stream reaches the end before
reading all the bytes.
IOException - if an I/O error occurs.
public int skipBytes(int n)
throws IOException
skipBytes
method of DataInput.
Bytes for this operation are read from the contained input stream.
skipBytes in interface DataInputn - the number of bytes to be skipped.
IOException - if an I/O error occurs.
public boolean readBoolean()
throws IOException
readBoolean
method of DataInput.
Bytes for this operation are read from the contained input stream.
readBoolean in interface DataInputboolean value read.
EOFException - if this input stream has reached the end.
IOException - if an I/O error occurs.
public byte readByte()
throws IOException
readByte
method of DataInput.
Bytes for this operation are read from the contained input stream.
readByte in interface DataInputbyte.
EOFException - if this input stream has reached the end.
IOException - if an I/O error occurs.
public int readUnsignedByte()
throws IOException
readUnsignedByte
method of DataInput.
Bytes for this operation are read from the contained input stream.
readUnsignedByte in interface DataInputEOFException - if this input stream has reached the end.
IOException - if an I/O error occurs.
public short readShort()
throws IOException
readShort
method of DataInput.
Bytes for this operation are read from the contained input stream.
readShort in interface DataInputEOFException - if this input stream reaches the end before
reading two bytes.
IOException - if an I/O error occurs.
public int readUnsignedShort()
throws IOException
readUnsignedShort
method of DataInput.
Bytes for this operation are read from the contained input stream.
readUnsignedShort in interface DataInputEOFException - if this input stream reaches the end before
reading two bytes.
IOException - if an I/O error occurs.
public char readChar()
throws IOException
readChar
method of DataInput.
Bytes for this operation are read from the contained input stream.
readChar in interface DataInputEOFException - if this input stream reaches the end before
reading two bytes.
IOException - if an I/O error occurs.
public int readInt()
throws IOException
readInt
method of DataInput.
Bytes for this operation are read from the contained input stream.
readInt in interface DataInputint.
EOFException - if this input stream reaches the end before
reading four bytes.
IOException - if an I/O error occurs.
public long readLong()
throws IOException
readLong
method of DataInput.
Bytes for this operation are read from the contained input stream.
readLong in interface DataInputlong.
EOFException - if this input stream reaches the end before
reading eight bytes.
IOException - if an I/O error occurs.
public String readUTF()
throws IOException
readUTF
method of DataInput.
Bytes for this operation are read from the contained input stream.
readUTF in interface DataInputEOFException - if this input stream reaches the end before
reading all the bytes.
IOException - if an I/O error occurs.DataInputStream.readUTF(java.io.DataInput)
public float readFloat()
throws IOException
readFloat in interface DataInputfloat value read.
EOFException - if this stream reaches the end before reading
all the bytes.
IOException - if an I/O error occurs.
public double readDouble()
throws IOException
readDouble in interface DataInputdouble value read.
EOFException - if this stream reaches the end before reading
all the bytes.
IOException - if an I/O error occurs.
public String readLine()
throws IOException
readLine in interface DataInputnull if the end of file is
encountered before a byte can be read.
IOException - if an I/O error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||