public byte [ ] getPQCodeByte ( String id ) throws Exception { int iid = getInternalId ( id ) ; if ( iid == - 1 ) { throw new Exception ( "Id does not exist!" ) ; } if ( numProductCentroids > 256 ) { throw new Exception ( "Call the short variant of the method!" ) ; } DatabaseEntry key = new DatabaseEntry ( ) ; IntegerBinding . intToEntry ( iid , key ) ; DatabaseEntry data = new DatabaseEntry ( ) ; if ( ( iidToIvfpqDB . get ( null , key , data , null ) == OperationStatus . SUCCESS ) ) { TupleInput input = TupleBinding . entryToInput ( data ) ; input . readInt ( ) ; // skip the list id byte [ ] code = new byte [ numSubVectors ] ; for ( int i = 0 ; i < numSubVectors ; i ++ ) { code [ i ] = input . readByte ( ) ; } return code ; } else { throw new Exception ( "Id does not exist!" ) ; } }
Returns the pq code of the image with the given id .