/** * Reads a variable-length zig-zag encoded signed integer up to 64 bits. * * @return the read integer as a long. * @throws EncodingException on decoding error. */ public long readZigZagVarInt64() throws EncodingException { final long vint64 = readVarInt64(); return (vint64 >>> 1) ^ -(vint64 & 1); // decode zig-zag back to two's-complement }
/** {@inheritDoc} */ @Override public Schema decode(ByteStreamArray bstream) throws IOException { final long schemaId = bstream.readVarInt64(); final Schema schema = mSchemaTable.getSchema(schemaId); if (null == schema) { throw new IOException( String.format("Schema with ID %d not found in schema table.", schemaId)); } return schema; } }
schemaId = new ByteStreamArray(result.getRow()).readVarInt64(); } catch (EncodingException exn) { LOG.error(String.format("Unable to decode schema ID encoded in row key %s: %s",