@Override public boolean equalBytes(byte[] bytes) { return equalBytes(bytes, 0, bytes.length); }
@Override public boolean equalBytes(byte[] bytes) { return equalBytes(bytes, 0, bytes.length); }
@Override public boolean equalBytes(byte[] bytes) { return equalBytes(bytes, 0, bytes.length); }
/** * Checks to see if passed bytes are equal to field * @param fieldId field to compare * @param utf8EncodedBytes bytes to compare * @return <code>true</code> if equal, else <code>false</code> */ public boolean isEqual(long fieldId, byte[] utf8EncodedBytes) { assert(0==Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).dims(fieldId)) : "This method only used for non dim fields."; final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); if (channelReader.available()>=2) { int length = channelReader.readShort(); return utf8EncodedBytes.length==length && channelReader.equalBytes(utf8EncodedBytes); } } return false; }
/** * Checks to see if passed bytes are equal to field * @param fieldId field to compare * @param utf8EncodedBytes bytes to compare * @return <code>true</code> if equal, else <code>false</code> */ public boolean isEqual(long fieldId, byte[] utf8EncodedBytes) { assert(0==Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).dims(fieldId)) : "This method only used for non dim fields."; final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); if (channelReader.available()>=2) { int length = channelReader.readShort(); return utf8EncodedBytes.length==length && channelReader.equalBytes(utf8EncodedBytes); } } return false; }
/** * Checks to see if passed bytes are equal to field * @param fieldId field to compare * @param utf8EncodedBytes bytes to compare * @return <code>true</code> if equal, else <code>false</code> */ public boolean isEqual(long fieldId, byte[] utf8EncodedBytes) { assert(0==Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).dims(fieldId)) : "This method only used for non dim fields."; final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); if (channelReader.available()>=2) { int length = channelReader.readShort(); return utf8EncodedBytes.length==length && channelReader.equalBytes(utf8EncodedBytes); } } return false; }