public static ByteArrayLenEncoding fromParams(final byte[] data) { final ByteBuffer buffer = ByteBuffer.wrap(data); final EncodingID lenID = EncodingID.values()[buffer.get()]; final int lenLength = ITF8.readUnsignedITF8(buffer); final byte[] lenBytes = new byte[lenLength]; buffer.get(lenBytes); final CRAMEncoding<Integer> lenEncoding = EncodingFactory.createEncoding(DataSeriesType.INT, lenID, lenBytes); final EncodingID byteID = EncodingID.values()[buffer.get()]; final int byteLength = ITF8.readUnsignedITF8(buffer); final byte[] byteBytes = new byte[byteLength]; buffer.get(byteBytes); final CRAMEncoding<byte[]> byteEncoding = EncodingFactory.createEncoding(DataSeriesType.BYTE_ARRAY, byteID, byteBytes); return new ByteArrayLenEncoding(lenEncoding, byteEncoding); }
public static ByteArrayLenEncoding fromParams(final byte[] data) { final ByteBuffer buffer = ByteBuffer.wrap(data); final EncodingID lenID = EncodingID.values()[buffer.get()]; final int lenLength = ITF8.readUnsignedITF8(buffer); final byte[] lenBytes = new byte[lenLength]; buffer.get(lenBytes); final CRAMEncoding<Integer> lenEncoding = EncodingFactory.createEncoding(DataSeriesType.INT, lenID, lenBytes); final EncodingID byteID = EncodingID.values()[buffer.get()]; final int byteLength = ITF8.readUnsignedITF8(buffer); final byte[] byteBytes = new byte[byteLength]; buffer.get(byteBytes); final CRAMEncoding<byte[]> byteEncoding = EncodingFactory.createEncoding(DataSeriesType.BYTE_ARRAY, byteID, byteBytes); return new ByteArrayLenEncoding(lenEncoding, byteEncoding); }
final DataSeries dataSeries = DataSeries.byCanonicalName(dataSeriesAbbreviation); final EncodingID id = EncodingID.values()[buffer.get()]; final int paramLen = ITF8.readUnsignedITF8(buffer); final byte[] paramBytes = new byte[paramLen]; final int key = ITF8.readUnsignedITF8(buf); final EncodingID id = EncodingID.values()[buf.get()]; final int paramLen = ITF8.readUnsignedITF8(buf); final byte[] paramBytes = new byte[paramLen];
final DataSeries dataSeries = DataSeries.byCanonicalName(dataSeriesAbbreviation); final EncodingID id = EncodingID.values()[buffer.get()]; final int paramLen = ITF8.readUnsignedITF8(buffer); final byte[] paramBytes = new byte[paramLen]; final int key = ITF8.readUnsignedITF8(buf); final EncodingID id = EncodingID.values()[buf.get()]; final int paramLen = ITF8.readUnsignedITF8(buf); final byte[] paramBytes = new byte[paramLen];