code: private int readFully(byte[] b, int offs, int len)
  		throws BitstreamException
  	{		
  		int nRead = 0;
  		try
  		{
  			while (len > 0)
  			{
  				int bytesread = source.read(b, offs, len);
  				if (bytesread == -1)
  				{
  					while (len-->0)
  					{
  						b[offs++] = 0;
  					}
  					break;
  					//throw newBitstreamException(UNEXPECTED_EOF, new EOFException());
  				}
  				nRead = nRead + bytesread;
  				offs += bytesread;
  				len -= bytesread;
  			}
  		}
  		catch (IOException ex)
  		{
  			throw newBitstreamException(STREAM_ERROR, ex);
  		}
  		return nRead;
  	}
docs: Reads the exact number of bytes from the source
  input stream into a byte array.
  
  @param b		The byte array to read the specified number
  of bytes into.
  @param offs	The index in the array where the first byte
  read should be stored.
  @param len	the number of bytes to read.
  
  @exception BitstreamException is thrown if the specified
  number of bytes could not be read from the stream.