@Override public PercentileCounter read(Kryo kryo, Input input, Class type) { double compression = input.readDouble(); double quantileRatio = input.readDouble(); int length = input.readInt(); byte[] buffer = new byte[length]; input.read(buffer); PercentileCounter counter = new PercentileCounter(compression, quantileRatio); counter.readRegisters(ByteBuffer.wrap(buffer)); return counter; } }
@Override public void read(Kryo kryo, Input in) { this.offset = BYTE_ARRAY_OFFSET; this.numBytes = in.readInt(); this.base = new byte[numBytes]; in.read((byte[]) base); }
/** Reads bytes.length bytes or less and writes them to the specified byte[], starting at 0, and returns the number of bytes * read. */ public int read (byte[] bytes) throws KryoException { return read(bytes, 0, bytes.length); }
@Override public void read(Kryo kryo, Input in) { this.baseOffset = BYTE_ARRAY_OFFSET; this.sizeInBytes = in.readInt(); this.numFields = in.readInt(); this.bitSetWidthInBytes = calculateBitSetWidthInBytes(numFields); this.baseObject = new byte[sizeInBytes]; in.read((byte[]) baseObject); } }
/** Reads bytes.length bytes or less and writes them to the specified byte[], starting at 0, and returns the number of bytes * read. */ public int read (byte[] bytes) throws KryoException { return read(bytes, 0, bytes.length); }
@Override public void read(Kryo kryo, Input in) { this.baseOffset = BYTE_ARRAY_OFFSET; this.sizeInBytes = in.readInt(); this.numFields = in.readInt(); this.bitSetWidthInBytes = calculateBitSetWidthInBytes(numFields); this.baseObject = new byte[sizeInBytes]; in.read((byte[]) baseObject); } }
@Override public int read() throws IOException { return in.read(); }
@Override public void read(Kryo kryo, Input in) { this.baseOffset = BYTE_ARRAY_OFFSET; this.sizeInBytes = in.readInt(); this.numFields = in.readInt(); this.bitSetWidthInBytes = calculateBitSetWidthInBytes(numFields); this.baseObject = new byte[sizeInBytes]; in.read((byte[]) baseObject); } }
@Override public int read(byte[] b, int off, int len) throws IOException { return in.read(b, off, len); }
@Override public ImmutableByteSequence read(Kryo kryo, Input input, Class<ImmutableByteSequence> type) { int length = input.readInt(); byte[] data = new byte[length]; int bytesRead = input.read(data); if (bytesRead != length) { throw new IllegalStateException("Byte sequence serializer read expected " + length + " but got " + bytesRead); } return ImmutableByteSequence.copyFrom(data); } }
@Override public int read() throws IOException { return in.read(); }
/** Reads bytes.length bytes or less and writes them to the specified byte[], starting at 0, and returns the number of bytes * read. */ public int read (byte[] bytes) throws KryoException { return read(bytes, 0, bytes.length); }
/** Reads bytes.length bytes or less and writes them to the specified byte[], starting at 0, and returns the number of bytes * read. */ public int read (byte[] bytes) throws KryoException { return read(bytes, 0, bytes.length); }
private static ByteBuffer toByteBuffer(Input input, int numBytes) { byte[] bytes = new byte[numBytes]; input.read(bytes); return ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); } }
@Override public MatcherList read(Kryo kryo, Input input, Class<MatcherList> type) { MatcherList matcherList = new MatcherList(); matcherList.maxSize = input.read(); // Note: The matches list is always empty after deserialization. matcherList.initialize(); return matcherList; }
@Override public MatchesList read(Kryo kryo, Input input, Class<MatchesList> type) { MatchesList matchesList = new MatchesList(); matchesList.maxSize = input.read(); // Note: The matches list is always empty after deserialization. matchesList.initialize(); return matchesList; }
@Override public void read(Kryo kryo, Input input) { readMetadata(kryo, input); int wkbLength = input.read(); byte[] wellKnownBinary = new byte[wkbLength]; input.read(wellKnownBinary); try { geometry = new WKBReader().read(wellKnownBinary); } catch (ParseException e) { throw new IllegalArgumentException("Cannot parse the geometry", e); } }
public Class read (Kryo kryo, Input input, Class<Class> type) { Registration registration = kryo.readClass(input); int isPrimitive = input.read(); Class typ = registration != null ? registration.getType() : null; if (typ == null || !typ.isPrimitive()) return typ; return (isPrimitive == 1) ? typ : getWrapperClass(typ); } }
public Class read (Kryo kryo, Input input, Class<Class> type) { Registration registration = kryo.readClass(input); int isPrimitive = input.read(); Class typ = registration != null ? registration.getType() : null; if (typ == null || !typ.isPrimitive()) return typ; return (isPrimitive == 1) ? typ : getWrapperClass(typ); } }
public Class read (Kryo kryo, Input input, Class<Class> type) { Registration registration = kryo.readClass(input); int isPrimitive = input.read(); Class typ = registration != null ? registration.getType() : null; if (typ == null || !typ.isPrimitive()) return typ; return (isPrimitive == 1) ? typ : getWrapperClass(typ); } }