public int read( ) throws IOException
	{ 
		String bits = "";
		int bit;
		int decode;

		while( true )
		{
			bit = bin.readBit( );
			if( bit == -1 )
				throw new IOException( "Unexpected EOF" );

			bits += bit;
			decode = codeTree.getChar( bits );
			if( decode == HuffmanTree.INCOMPLETE_CODE )
				continue;
			else if( decode == HuffmanTree.ERROR )
				throw new IOException( "Decoding error" );
			else if( decode == HuffmanTree.END )
				return -1;
			else
				return decode;
		}
	}