private static Bits newBitsForStep8( int length ) { return Bits.bits(calculateNumberOfBlocksUsedForStep8(length) << 3 ); //*8 }
public static int calculateNumberOfBlocksUsed( long firstBlock ) { /* * [ lll,llle][eeee,tttt][kkkk,kkkk][kkkk,kkkk][kkkk,kkkk] */ int encoding = (int) ( ( firstBlock & 0x1F0000000L ) >> 28 ); int length = (int) ( ( firstBlock & 0x7E00000000L ) >> 33 ); if ( encoding == ENCODING_UTF8 || encoding == ENCODING_LATIN1 ) { return calculateNumberOfBlocksUsedForStep8(length); } LongerShortString encodingTable = getEncodingTable( encoding ); if ( encodingTable == null ) { // We probably did an inconsistent read of the first block return PropertyType.BLOCKS_USED_FOR_BAD_TYPE_OR_ENCODING; } return calculateNumberOfBlocksUsed( encodingTable, length ); }
private static Bits newBitsForStep8( int length ) { return Bits.bits(calculateNumberOfBlocksUsedForStep8(length) << 3 ); //*8 }
public static int calculateNumberOfBlocksUsed( long firstBlock ) { /* * [ lll,llle][eeee,tttt][kkkk,kkkk][kkkk,kkkk][kkkk,kkkk] */ int encoding = (int) ( ( firstBlock & 0x1F0000000L ) >> 28 ); int length = (int) ( ( firstBlock & 0x7E00000000L ) >> 33 ); if ( encoding == ENCODING_UTF8 || encoding == ENCODING_LATIN1 ) { return calculateNumberOfBlocksUsedForStep8(length); } LongerShortString encodingTable = getEncodingTable( encoding ); if ( encodingTable == null ) { // We probably did an inconsistent read of the first block return PropertyType.BLOCKS_USED_FOR_BAD_TYPE_OR_ENCODING; } return calculateNumberOfBlocksUsed( encodingTable, length ); }