public void writeTo(DataOutput out) throws Exception { out.writeByte(type); out.writeShort(id); }
@Override public void write(DataOutput out) throws IOException { out.writeShort(THREE_LONGS); out.writeLong(pathHash); out.writeLong(modTime); out.writeLong(length); }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
@Override public void writeTo(DataOutput out) throws Exception { if (ip_addr != null) { byte[] address = ip_addr.getAddress(); // 4 bytes (IPv4) or 16 bytes (IPv6) out.writeByte(address.length); // 1 byte out.write(address, 0, address.length); if (ip_addr instanceof Inet6Address) out.writeInt(((Inet6Address) ip_addr).getScopeId()); } else { out.writeByte(0); } out.writeShort(port); out.writeInt(vmViewId); out.writeLong(mostSigBits); out.writeLong(leastSigBits); }
public void tightMarshalLong2(OpenWireFormat wireFormat, long o, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { if (bs.readBoolean()) { dataOut.writeLong(o); } else { dataOut.writeInt((int)o); } } else { if (bs.readBoolean()) { dataOut.writeShort((int)o); } } }
public static void writeArrayLength(int len, DataOutput out) throws IOException { if (len == -1) { out.writeByte(NULL_ARRAY); } else if (len <= MAX_BYTE_ARRAY_LEN) { out.writeByte(len); } else if (len <= 0xFFFF) { out.writeByte(SHORT_ARRAY_LEN); out.writeShort(len); } else { out.writeByte(INT_ARRAY_LEN); out.writeInt(len); } }
protected void looseMarshalObjectArray(OpenWireFormat wireFormat, DataStructure[] objects, DataOutput dataOut) throws IOException { dataOut.writeBoolean(objects != null); if (objects != null) { dataOut.writeShort(objects.length); for (int i = 0; i < objects.length; i++) { looseMarshalNestedObject(wireFormat, objects[i], dataOut); } } }
/** * Write this datagram to a random access file or data output stream. * * @param out * out * @throws IOException * IOException */ public void write(DataOutput out) throws IOException { out.writeLong(duration); out.writeInt(getLength()); for (int i = 0; i < quantizedCoeffs.length; i++) { out.writeShort(quantizedCoeffs[i]); } out.write(quantizedResidual); }
@Override public void visit(LongConstantInstruction insn) { try { output.writeByte(4); output.writeShort(insn.getReceiver().getIndex()); output.writeLong(insn.getConstant()); } catch (IOException e) { throw new IOExceptionWrapper(e); } }
private void writeAnnotation(DataOutput output, AnnotationReader annotation) throws IOException { output.writeInt(symbolTable.lookup(annotation.getType())); int fieldCount = 0; for (@SuppressWarnings("unused") String field : annotation.getAvailableFields()) { ++fieldCount; } output.writeShort(fieldCount); for (String field : annotation.getAvailableFields()) { output.writeInt(symbolTable.lookup(field)); writeAnnotationValue(output, annotation.getValue(field)); } }
protected void tightMarshalObjectArray2(OpenWireFormat wireFormat, DataStructure[] objects, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { dataOut.writeShort(objects.length); for (int i = 0; i < objects.length; i++) { tightMarshalNestedObject2(wireFormat, objects[i], dataOut, bs); } } }
@Override @InterfaceAudience.Private public void write(DataOutput out) throws IOException { out.writeLong(blockSize); out.writeInt(bytesPerChecksum); out.writeInt(writePacketSize); out.writeShort(replication); out.writeInt(fileBufferSize); WritableUtils.writeEnum(out, checksumType); out.writeByte(storagepolicyId); }
public void tightMarshalLong2(OpenWireFormat wireFormat, long o, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { if (bs.readBoolean()) { dataOut.writeLong(o); } else { dataOut.writeInt((int)o); } } else { if (bs.readBoolean()) { dataOut.writeShort((int)o); } } }
public static void writeMessageListHeader(Address dest, Address src, byte[] cluster_name, int numMsgs, DataOutput dos, boolean multicast) throws Exception { dos.writeShort(Version.version); byte flags=LIST; if(multicast) flags+=MULTICAST; dos.writeByte(flags); Util.writeAddress(dest, dos); Util.writeAddress(src, dos); dos.writeShort(cluster_name != null? cluster_name.length : -1); if(cluster_name != null) dos.write(cluster_name); dos.writeInt(numMsgs); }
protected void looseMarshalObjectArray(OpenWireFormat wireFormat, DataStructure[] objects, DataOutput dataOut) throws IOException { dataOut.writeBoolean(objects != null); if (objects != null) { dataOut.writeShort(objects.length); for (int i = 0; i < objects.length; i++) { looseMarshalNestedObject(wireFormat, objects[i], dataOut); } } }
public void writeTo(DataOutput out) throws Exception { out.writeByte(type); Bits.writeLong(seqno,out); out.writeShort(num_seqnos); }
/** * Write this datagram to a random access file or data output stream. * * @param out * out * @throws IOException * IOException */ public void write(DataOutput out) throws IOException { out.writeLong(duration); out.writeInt(getLength()); for (int i = 0; i < quantizedCoeffs.length; i++) { out.writeShort(quantizedCoeffs[i]); } out.write(quantizedResidual); }
@Override public void write(DataOutput out) throws IOException { out.writeShort(THREE_LONGS); out.writeLong(pathHash); out.writeLong(modTime); out.writeLong(length); }
public void write(DataOutput output, RegularMethodNode method) throws IOException { output.writeInt(ElementModifier.pack(method.getModifiers())); output.writeShort(method.getVariables().size()); for (VariableNode var : method.getVariables()) { write(output, var); } try { method.getBody().acceptVisitor(new NodeWriter(output)); } catch (IOExceptionWrapper e) { throw new IOException("Error writing method body", e.getCause()); } }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }