/** * Writes a boolean as a typed bytes sequence. * * @param b * the boolean to be written * @throws IOException */ public void writeBool(boolean b) throws IOException { out.write(Type.BOOL.code); out.writeBoolean(b); }
protected void looseMarshalByteArray(OpenWireFormat wireFormat, byte[] data, DataOutput dataOut) throws IOException { dataOut.writeBoolean(data != null); if (data != null) { dataOut.writeInt(data.length); dataOut.write(data); } }
@Override public void write(DataOutput out) throws IOException { out.writeLong(version); if (methods == null) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeInt(methods.length); for (int method : methods) { out.writeInt(method); } } }
@Override public void write(DataOutput output) throws IOException { output.writeByte(inResponseTo ^ RESPONSE_MASK); output.writeInt(correlationId); output.writeByte(SUCCESS); output.writeByte(BOOLEAN); output.writeBoolean(response); } });
out.writeShort(poolSize); for (int i=0; i<poolSize; i++) { out.writeUTF(pool[i]); out.writeInt(size); if (pool[j].equals(nameKey)) { if (poolSize < 256) { out.writeByte(j); } else { out.writeShort(j); out.writeBoolean(iTailZone != null); if (iTailZone != null) { iTailZone.writeTo(out);
public void writeTo(DataOutput out) throws IOException { out.writeByte(iMode); out.writeByte(iMonthOfYear); out.writeByte(iDayOfMonth); out.writeByte(iDayOfWeek); out.writeBoolean(iAdvance); writeMillis(out, iMillisOfDay); }
@Override public void toData(DataOutput out) throws IOException { out.writeBoolean(this.hasKeys); if (this.objectTypeArray != null) { int numObjects = this.objects.size(); out.writeInt(numObjects); for (int index = 0; index < numObjects; ++index) { Object value = this.objects.get(index); out.writeByte(KEY_NOT_AT_SERVER); } else if (objectType == EXCEPTION) { out.writeByte(EXCEPTION); } else { out.writeByte(OBJECT); out.write((byte[]) value); } else if (objectType == EXCEPTION) { out.writeInt(0);
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); } } }
@Override public void toData(DataOutput out) throws IOException { super.toData(out); out.writeUTF(this.serviceName); DataSerializer.writeObject(this.objectName, out); out.writeLong(this.startTime); out.writeLong(this.leaseMillis); out.writeLong(this.waitMillis); out.writeBoolean(this.reentrant); out.writeBoolean(this.tryLock); out.writeInt(this.processorId); out.writeInt(this.lockId); out.writeInt(this.threadId); out.writeLong(this.grantorVersion); out.writeInt(this.grantorSerialNumber); out.writeInt(this.dlsSerialNumber); }
/** * Writes UUID to output stream. This method is meant to be used by * implementations of {@link Externalizable} interface. * * @param out Output stream. * @param uid UUID to write. * @throws IOException If write failed. */ public static void writeUuid(DataOutput out, UUID uid) throws IOException { // Write null flag. out.writeBoolean(uid == null); if (uid != null) { out.writeLong(uid.getMostSignificantBits()); out.writeLong(uid.getLeastSignificantBits()); } }
protected void looseMarshalByteArray(OpenWireFormat wireFormat, byte[] data, DataOutput dataOut) throws IOException { dataOut.writeBoolean(data != null); if (data != null) { dataOut.writeInt(data.length); dataOut.write(data); } }
@Override public void write(DataOutput output) throws IOException { output.writeByte(inResponseTo ^ RESPONSE_MASK); output.writeInt(correlationId); output.writeByte(SUCCESS); output.writeByte(BOOLEAN); output.writeBoolean(response); } });
out.writeShort(poolSize); for (int i=0; i<poolSize; i++) { out.writeUTF(pool[i]); out.writeInt(size); if (pool[j].equals(nameKey)) { if (poolSize < 256) { out.writeByte(j); } else { out.writeShort(j); out.writeBoolean(iTailZone != null); if (iTailZone != null) { iTailZone.writeTo(out);
@Override public void toData(DataOutput out) throws IOException { DataSerializer.writeString(name, out); out.writeLong(length); out.writeInt(chunks); out.writeLong(created); out.writeLong(modified); out.writeLong(id.getMostSignificantBits()); out.writeLong(id.getLeastSignificantBits()); out.writeBoolean(possiblyRenamed); }
public void writeTo(DataOutput out) throws IOException { out.writeByte(iMode); out.writeByte(iMonthOfYear); out.writeByte(iDayOfMonth); out.writeByte(iDayOfWeek); out.writeBoolean(iAdvance); writeMillis(out, iMillisOfDay); }
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 writeExternal(DataOutput out) throws IOException { out.writeUTF(this.jobId); out.writeInt(this.repeat); out.writeLong(this.startTime); out.writeLong(this.delay); out.writeLong(this.nextTime); out.writeLong(this.period); if (this.cronEntry == null) { this.cronEntry = ""; } out.writeUTF(this.cronEntry); this.location.writeExternal(out); if (lastUpdate != null) { out.writeBoolean(true); this.lastUpdate.writeExternal(out); } else { out.writeBoolean(false); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeBoolean(_isShrinked); if (_isShrinked) { out.writeLong(shrinkedLength); } } }
private byte[] asByte(Object object) throws IOException { ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); DataOutput dataOutput = new DataOutputStream(byteOut); dataOutput.writeBoolean(false); ByteArrayOutputStream javaByteOut = new ByteArrayOutputStream(); ObjectOutput objectOutput = new ObjectOutputStream(javaByteOut); objectOutput.writeObject(object); dataOutput.write(javaByteOut.toByteArray()); return byteOut.toByteArray(); }
protected void looseMarshalByteArray(OpenWireFormat wireFormat, byte[] data, DataOutput dataOut) throws IOException { dataOut.writeBoolean(data != null); if (data != null) { dataOut.writeInt(data.length); dataOut.write(data); } }