private byte[] 
	getByteArrayFromStream(
		BDecoderInputStream dbis )
		
		throws IOException 
	{
		int length = (int) getNumberFromStream(dbis, ':');

		if (length < 0) {
			return null;
		}

		// note that torrent hashes can be big (consider a 55GB file with 2MB pieces
		// this generates a pieces hash of 1/2 meg

		if ( length > 8*1024*1024 ){

			throw( new IOException( "Byte array length too large (" + length + ")"));
		}

		byte[] tempArray = new byte[length];
		int count = 0;
		int len = 0;
		//get the string
		while (count != length && (len = dbis.read(tempArray, count, length - count)) > 0) {
			count += len;
		}

		if ( count != tempArray.length ){
			throw( new IOException( "BDecoder::getByteArrayFromStream: truncated"));
		}

		return tempArray;
	}