code: public void write(byte data) throws IOException {
      fos.write(data);
      if(position + 1 > size)
        size = position+1;
      position+= 1;
    }
docs: Write a byte to this stream.
  @param data byte to write.
  @throws IOException IOException will be raised if an error occurred while
  writing.