public Client( int worstCaseLongsNeeded ) { this.labelScratch = new long[worstCaseLongsNeeded]; this.labelBits = bitsFromLongs( labelScratch ); } }
public static String versionLongToString( long storeVersion ) { if ( storeVersion == -1 ) { return CommonAbstractStore.UNKNOWN_VERSION; } Bits bits = Bits.bitsFromLongs( new long[]{storeVersion} ); int length = bits.getShort( 8 ); if ( length == 0 || length > 7 ) { throw new IllegalArgumentException( format( "The read version string length %d is not proper.", length ) ); } char[] result = new char[length]; for ( int i = 0; i < length; i++ ) { result[i] = (char) bits.getShort( 8 ); } return new String( result ); }
public static Value decode( PropertyBlock block ) { Bits bits = Bits.bitsFromLongs( Arrays.copyOf( block.getValueBlocks(), block.getValueBlocks().length) ); return decode( bits ); }
public static long[] parseInlined( long labelField ) { byte numberOfLabels = labelCount( labelField ); if ( numberOfLabels == 0 ) { return EMPTY_LONG_ARRAY; } long existingLabelsField = parseLabelsBody( labelField ); byte bitsPerLabel = (byte) (LABEL_BITS / numberOfLabels); Bits bits = bitsFromLongs( new long[]{existingLabelsField} ); long[] result = new long[numberOfLabels]; for ( int i = 0; i < result.length; i++ ) { result[i] = bits.getLong( bitsPerLabel ); } return result; }
public Client( int worstCaseLongsNeeded ) { this.labelScratch = new long[worstCaseLongsNeeded]; this.labelBits = bitsFromLongs( labelScratch ); } }
public static String versionLongToString( long storeVersion ) { if ( storeVersion == -1 ) { return CommonAbstractStore.UNKNOWN_VERSION; } Bits bits = Bits.bitsFromLongs( new long[]{storeVersion} ); int length = bits.getShort( 8 ); if ( length == 0 || length > 7 ) { throw new IllegalArgumentException( format( "The read version string length %d is not proper.", length ) ); } char[] result = new char[length]; for ( int i = 0; i < length; i++ ) { result[i] = (char) bits.getShort( 8 ); } return new String( result ); }
public static Value decode( PropertyBlock block ) { Bits bits = Bits.bitsFromLongs( Arrays.copyOf( block.getValueBlocks(), block.getValueBlocks().length) ); return decode( bits ); }
public static long[] parseInlined( long labelField ) { byte numberOfLabels = labelCount( labelField ); if ( numberOfLabels == 0 ) { return EMPTY_LONG_ARRAY; } long existingLabelsField = parseLabelsBody( labelField ); byte bitsPerLabel = (byte) (LABEL_BITS / numberOfLabels); Bits bits = bitsFromLongs( new long[]{existingLabelsField} ); long[] result = new long[numberOfLabels]; for ( int i = 0; i < result.length; i++ ) { result[i] = bits.getLong( bitsPerLabel ); } return result; }