Reading and writing binary data should include the read and write methods. InputStream class defines the following methods for reading bytes:
- int read() throws IOException
- int read(byte b[]) throws IOException
- int read(byte b[], int offset, int length) throws IOException
OutputStream class defines the following methods for writing bytes:
- void write(int b) throws IOException
- void write(byte b[]) throws IOException
- void write(byte b[], int offset, int length) throws IOException