@Override public byte[] readBytes() throws IOException { try { int len = input.readInt(); if (len < 0) { return null; } else if (len == 0) { return new byte[]{}; } else { return input.readBytes(len); } } catch (KryoException e) { throw new IOException(e); } }
@Override public byte[] readBytes() throws IOException { try { int len = input.readInt(); if (len < 0) { return null; } else if (len == 0) { return new byte[]{}; } else { return input.readBytes(len); } } catch (KryoException e) { throw new IOException(e); } }
@Override public ByteBuffer read(Kryo kryo, Input input, Class<ByteBuffer> type) { int len = input.readInt(); return ByteBuffer.wrap(input.readBytes(len)); } }
@Override public Object read(Kryo kryo, Input input, Class c) { int len = input.readInt(); byte[] ser = new byte[len]; input.readBytes(ser); ByteArrayInputStream bis = new ByteArrayInputStream(ser); try { ObjectInputStream ois = new ObjectInputStream(bis); return ois.readObject(); } catch (Exception e) { throw new RuntimeException(e); } } }
@Override public PyLong read(Kryo kryo, Input input, Class<PyLong> type) { int length = input.readShort(); return new PyLong(new BigInteger(input.readBytes(length))); } }
public BytesWritable read(Kryo kryo, Input input, Class<BytesWritable> type) { int len = input.readVarInt(true); byte[] bytes = new byte[len]; input.readBytes(bytes); return new BytesWritable(bytes); }
private BytesWritable readValue(Input input) { return new BytesWritable(input.readBytes(input.readInt())); }
private BytesWritable readValue(Input input) { return new BytesWritable(input.readBytes(input.readInt())); }
@Override public TupleImpl read(Kryo kryo, Input input, Class<TupleImpl> type) { int length = input.readInt(); byte[] bytes = input.readBytes(length); return tupleDeserializer.deserialize(bytes); } }
public HiveKey read(Kryo kryo, Input input, Class<HiveKey> type) { int len = input.readVarInt(true); byte[] bytes = new byte[len]; input.readBytes(bytes); return new HiveKey(bytes); } }
@Override public Object read(Kryo kryo, Input input, Class c) { int len = input.readInt(); byte[] ser = new byte[len]; input.readBytes(ser); ByteArrayInputStream bis = new ByteArrayInputStream(ser); try { ClassLoaderObjectInputStream ois = new ClassLoaderObjectInputStream(kryo.getClassLoader(), bis); return ois.readObject(); } catch (Exception e) { throw new RuntimeException(e); } } }
public HiveKey read(Kryo kryo, Input input, Class<HiveKey> type) { int len = input.readVarInt(true); byte[] bytes = new byte[len]; input.readBytes(bytes); return new HiveKey(bytes, input.readVarInt(false)); } }
public PyObject read(Kryo kryo, Input input, Class<PyObject> type) { int len = input.readInt(); byte[] serPo = input.readBytes(len); try { return (PyObject) SerializationUtils.deserializeObject(serPo); } catch (IOException e) { throw new KryoException("Failed to deserialize object.", e); } catch (ClassNotFoundException e) { // this should only be possible if jython isn't on the class-path throw new KryoException("Failed to deserialize object.", e); } } }
@Override public TestRecord read(Kryo kryo, Input input, Class<TestRecord> type) { int length = input.readInt(); byte[] buffer = input.readBytes(length); return new TestRecord(buffer); } }
private HiveKey readHiveKey(Input input) { HiveKey hiveKey = new HiveKey(input.readBytes(input.readInt()), input.readInt()); hiveKey.setDistKeyLength(input.readInt()); return hiveKey; }
private HiveKey readHiveKey(Input input) { HiveKey hiveKey = new HiveKey( input.readBytes(input.readInt()), input.readInt()); hiveKey.setDistKeyLength(input.readInt()); return hiveKey; }
@Override public byte[] readBytes(final int size) { return unshadedInput.readBytes(size); }
@Override public void read(Kryo kryo, Input input) { int numVariableMappings = input.readShort(); variableMappings = new ArrayList<>(numVariableMappings); for(int i = 0;i < numVariableMappings;++i) { int size = input.readInt(); if(size > 0) { byte[] bytes = input.readBytes(size); Map m = SerDeUtils.fromBytes(bytes, Map.class); variableMappings.add(m); } } } }
/** Reads the specified number of bytes into a new byte[]. */ public byte[] readBytes (int length) throws KryoException { byte[] bytes = new byte[length]; readBytes(bytes, 0, length); return bytes; }
@Override public void read(Kryo kryo, Input input) { int digestSize = input.readInt(); byte[] digestBytes = input.readBytes(digestSize); ByteBuffer digestBuff = ByteBuffer.wrap(digestBytes); digest = AVLTreeDigest.fromBytes(digestBuff); n = input.readLong(); sum = input.readDouble(); sumOfSquares = input.readDouble(); sumOfLogs = input.readDouble(); min = input.readDouble(); max = input.readDouble(); M1 = input.readDouble(); M2 = input.readDouble(); M3 = input.readDouble(); M4 = input.readDouble(); } }