@Override public void writeByte(byte v) throws IOException { output.writeByte(v); }
@Override public void writeByte(byte v) throws IOException { output.writeByte(v); }
public void write (Kryo kryo, Output output) { output.writeInt(objectID, true); output.writeInt(cachedMethod.methodClassID, true); output.writeByte(cachedMethod.methodIndex); Serializer[] serializers = cachedMethod.serializers; Object[] args = this.args; for (int i = 0, n = serializers.length; i < n; i++) { Serializer serializer = serializers[i]; if (serializer != null) kryo.writeObjectOrNull(output, args[i], serializer); else kryo.writeClassAndObject(output, args[i]); } output.writeByte(responseData); }
private static void writePayload(Kryo kryo, Output out, Message message) { if (message.getPayload() instanceof Object[]) { out.writeByte(PayloadType.OBJECT_ARRAY.id); kryo.writeObject(out, message.getPayload()); return; } if (message.getPayload() == null) { out.writeByte(PayloadType.NULL.id); return; } out.writeByte(PayloadType.UNKNOWN.id); kryo.writeClassAndObject(out, message.getPayload()); }
private static void writeHeaders(Kryo kryo, Output out, Map<String, Object> headers) { if (headers == null || headers.isEmpty()) { out.writeInt(0); return; } out.writeInt(headers.size()); for (Map.Entry<String, Object> entry : headers.entrySet()) { out.writeString(entry.getKey()); ValueType valueType = ValueType.getType(entry.getValue()); out.writeByte(valueType.id); if (valueType.equals(ValueType.STRING)) { out.writeString(String.valueOf(entry.getValue())); } else if (valueType.equals(ValueType.INT)) { out.writeInt((Integer) entry.getValue()); } else { kryo.writeClassAndObject(out, entry.getValue()); } } }
private static void writeObjectId(Kryo kryo, Output out, Message message) { ValueType valueTypeForObjectId = ValueType.getType(message.getObjectId()); out.writeByte(valueTypeForObjectId.id); if (valueTypeForObjectId.equals(ValueType.STRING)) { out.writeString(String.valueOf(message.getObjectId())); } else if (valueTypeForObjectId.equals(ValueType.INT)) { out.writeInt((Integer) message.getObjectId()); } else { kryo.writeClassAndObject(out, message.getObjectId()); } }
@Override public void writeByte(final byte b) { unshadedOutput.writeByte(b); }
private void writeType(Output output, Type type) { output.writeByte((byte) type.id); } }
private void writeType(Output out, Type type) { out.writeByte((byte) type.id); }
public void write (Kryo kryo, Output output, Class object) { kryo.writeClass(output, object); output.writeByte((object != null && object.isPrimitive()) ? 1 : 0); }
static void write (Output out, ZoneOffset obj) { final int offsetSecs = obj.getTotalSeconds(); int offsetByte = offsetSecs % 900 == 0 ? offsetSecs / 900 : 127; // compress to -72 to +72 out.writeByte(offsetByte); if (offsetByte == 127) { out.writeInt(offsetSecs); } }
@Override public void write(final Kryo kryo, final Output output) { kryo.writeObject(output, this.name); output.writeInt(this.originalSignatures.size()); for (final Entry<Signature, MemberType> entry : this.originalSignatures.entrySet()) { output.writeByte(SignatureTypes.indexOf(entry.getKey().getClass())); kryo.writeObject(output, entry.getKey()); kryo.writeObject(output, entry.getValue().getName()); kryo.writeObject(output, entry.getValue().getDeclaringClass()); kryo.writeObject(output, this.getParameterTypes(entry.getValue())); } }
static void write (Output out, ZoneOffset obj) { final int offsetSecs = obj.getTotalSeconds(); int offsetByte = offsetSecs % 900 == 0 ? offsetSecs / 900 : 127; // compress to -72 to +72 out.writeByte(offsetByte); if (offsetByte == 127) { out.writeInt(offsetSecs); } }
public void write (Output output, Object object) { try { output.writeByte(field.getByte(object)); } catch (Exception e) { KryoException ex = new KryoException(e); ex.addTrace(this + " (" + type.getName() + ")"); throw ex; } }
public void write (Output output, Object object) { try { output.writeByte(field.getByte(object)); } catch (Exception e) { KryoException ex = new KryoException(e); ex.addTrace(this + " (" + type.getName() + ")"); throw ex; } }
public void write (Output output, Object object) { try { output.writeByte(field.getByte(object)); } catch (Exception e) { KryoException ex = new KryoException(e); ex.addTrace(this + " (" + type.getName() + ")"); throw ex; } }