@Override public boolean readBoolean() throws IOException { return readByte()==1; }
@Override public boolean readBoolean() throws IOException { return readByte()==1; }
public boolean readBoolean() throws IOException { return readByte()==1; }
/** * The counterpart for the above * * @param in * @return the int value * @throws IOException */ public static int readVInt(FastInputStream in) throws IOException { byte b = in.readByte(); int i = b & 0x7F; for (int shift = 7; (b & 0x80) != 0; shift += 7) { b = in.readByte(); i |= (b & 0x7F) << shift; } return i; }
protected FastInputStream initRead(InputStream is) throws IOException { assert !alreadyUnmarshalled; FastInputStream dis = FastInputStream.wrap(is); version = dis.readByte(); if (version != VERSION) { throw new RuntimeException("Invalid version (expected " + VERSION + ", but " + version + ") or the data in not in 'javabin' format"); } alreadyUnmarshalled = true; return dis; }
public Object unmarshal(InputStream is) throws IOException { FastInputStream dis = FastInputStream.wrap(is); version = dis.readByte(); if (version != VERSION) { throw new RuntimeException("Invalid version (expected " + VERSION + ", but " + version + ") or the data in not in 'javabin' format"); } return readVal(dis); }
public NamedList unmarshal(InputStream is) throws IOException { FastInputStream dis = FastInputStream.wrap(is); byte version = dis.readByte(); return (NamedList)readVal(dis); }
private boolean readTillDocs() throws IOException { if (isObjectType(fis)) { if (tagByte == SOLRDOCLST) { readVal(fis);// this is the metadata, throw it away tagByte = fis.readByte(); arraySize = readSize(fis); return true; } for (int i = objectSize; i > 0; i--) { Object k = readVal(fis); if (k == END_OBJ) break; if ("docs".equals(k)) { tagByte = fis.readByte(); if (tagByte == ITERATOR) return true;//docs must be an iterator or if (tagByte >>> 5 == ARR >>> 5) {// an array arraySize = readSize(fis); return true; } return false; } else { if (readTillDocs()) return true; } } } else { readObject(fis); return false; } return false; //here after it will be a stream of maps }