No. The compressed file is a binary file.
The DataInputStream
class is the compliment of
the DataOutputStream
class.
Files (and other streams) written with one are usually
read with the other.
Here is a list of some of the methods:
Constructor
public DataInputStream(InputStream in) Construct a data input stream.
Methods
public void close() throws IOException public final boolean readBoolean() throws IOException Reads a boolean represented as a 1-byte value. public final byte readByte() throws IOException public final char readChar() throws IOException public final double readDouble() throws IOException public final float readFloat() throws IOException public final int readInt() throws IOException public final long readLong() throws IOException public final short readShort() throws IOException public final int readUnsignedByte() throws IOException
All these methods throw an IOException
if an error occurs.
Upon reaching end of file they throw an EOFException
.
Reaching end of file is not an error;
but throwing an exception is a convenient way of signaling
when this happens.
(Thought question: ) Why does readUnsignedByte()
return an int
and not a byte
?