/** * Warning: the result is negative in Java if UInt8 > 0x7f * @return next UInt8 value as a byte * @throws IOException */ public byte readUInt8AsByte() throws IOException { return in.readByte(); }
/** * Warning: the result is negative in Java if UInt8 > 0x7f * @return next UInt8 value as a byte * @throws IOException */ public byte readUInt8AsByte() throws IOException { return in.readByte(); }
public byte readInt8() throws IOException { return in.readByte(); }
public byte readInt8() throws IOException { return in.readByte(); }
private static void validateHeaderAndVersion(LittleEndianDataInputStream input) throws IOException { char[] header = new char[8]; for (int i = 0; i < 8; i++) { header[i] = (char) input.readByte(); } if (!"ACCESSGR".equals(new String(header))) { throw new IllegalArgumentException("Input not in access grid format!"); } int version = input.readInt(); if (version != ACCESS_GRID_VERSION) { throw new IllegalArgumentException(String.format("Version mismatch of access grids, expected %s, found %s", ACCESS_GRID_VERSION, version)); } }
@Override public byte readByte() { try { return dataInputStream.readByte(); } catch (IOException e) { throw new RuntimeIOException(e); } }
@Override public byte readByte() { try { return dataInputStream.readByte(); } catch (IOException e) { throw new RuntimeIOException(e); } }
private static void validateHeaderAndVersion(LittleEndianDataInputStream input) throws IOException { char[] header = new char[8]; for (int i = 0; i < 8; i++) { header[i] = (char) input.readByte(); } if (!"ACCESSGR".equals(new String(header))) { throw new IllegalArgumentException("Input not in access grid format!"); } int version = input.readInt(); if (version != ACCESS_GRID_VERSION) { throw new IllegalArgumentException(String.format("Version mismatch of access grids, expected %s, found %s", ACCESS_GRID_VERSION, version)); } }
private void parseHeadline(LittleEndianDataInputStream input) throws IOException { ByteArrayDataOutput out = ByteStreams.newDataOutput(); byte c; while((c = input.readByte()) != '\n') { out.writeByte(c); } String[] headline = new String(out.toByteArray(), StandardCharsets.UTF_8).split(" "); this.numberOfVectors = Integer.parseInt(headline[0]); this.dimensions = Integer.parseInt(headline[1]); }
header[i] = (char) data.readByte();
header[i] = (char) input.readByte();
header[i] = (char) input.readByte();
header[i] = (char) data.readByte();
private void setCurrentContent() throws IOException { if (numberOfVectors > 0) { numberOfVectors--; ByteArrayDataOutput out = ByteStreams.newDataOutput(); byte b; while ((b = input.readByte()) != ' ') { out.writeByte(b); } String word = new String(out.toByteArray(), StandardCharsets.UTF_8); if (this.sparse) { this.currentVector = new TermVector(true, word, readSparseVector(this.dimensions)); } else { this.currentVector = new TermVector(false, word, readDenseVector(this.dimensions)); } } else { this.currentVector = null; } }
while ((headerType = ledis.readByte()) != HeaderType.END) { switch (headerType) {