@Override @InterfaceAudience.Private public void readFields(DataInput in) throws IOException { blockSize = in.readLong(); bytesPerChecksum = in.readInt(); writePacketSize = in.readInt(); replication = in.readShort(); fileBufferSize = in.readInt(); checksumType = WritableUtils.readEnum(in, DataChecksum.Type.class); storagepolicyId = in.readByte(); } }
protected ByteSequence looseUnmarshalByteSequence(DataInput dataIn) throws IOException { ByteSequence rc = null; if (dataIn.readBoolean()) { int size = dataIn.readInt(); byte[] t = new byte[size]; dataIn.readFully(t); rc = new ByteSequence(t, 0, size); } return rc; } }
public long tightUnmarshalLong(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException { if (bs.readBoolean()) { if (bs.readBoolean()) { return dataIn.readLong(); } else { return toLong(dataIn.readInt()); } } else { if (bs.readBoolean()) { return toLong(dataIn.readShort()); } else { return 0; } } }
/** * Fill out this instance of the message using the <code>DataInput</code> Required to be a * {@link org.apache.geode.DataSerializable}Note: must be symmetric with * {@link #toData(DataOutput)}in what it reads */ @Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { super.fromData(in); this.flags = in.readShort(); setBooleans(this.flags, in); this.regionId = in.readInt(); // extra field post 9.0 if (InternalDataSerializer.getVersionForDataStream(in).compareTo(Version.GFE_90) >= 0) { this.isTransactionDistributed = in.readBoolean(); } }
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.memberId = new InternalDistributedMember(); InternalDataSerializer.invokeFromData(this.memberId, in); this.prType = in.readInt(); this.isPersistent = in.readBoolean(); this.cacheLoaderWriterByte = in.readByte(); this.serialNumber = in.readInt(); }
private static int readDSFIDHeader(final DataInput in, DSCODE dscode) throws IOException { switch (dscode) { case DS_FIXED_ID_BYTE: return in.readByte(); case DS_FIXED_ID_SHORT: return in.readShort(); case DS_FIXED_ID_INT: return in.readInt(); default: throw new IllegalStateException("unexpected byte: " + dscode + " while reading dsfid"); } }
protected void readFrom(DataInput in, boolean read_type) throws Exception { if(read_type) type=GossipType.values()[in.readByte()]; group=Bits.readString(in); addr=Util.readAddress(in); sender=Util.readAddress(in); if(type != GossipType.MESSAGE) { logical_name=Bits.readString(in); short len=in.readShort(); if(len > 0) { ping_data=new ArrayList<>(len); for(int i=0; i < len; i++) { PingData data=new PingData(); data.readFrom(in); ping_data.add(data); } } physical_addr=(PhysicalAddress)Util.readAddress(in); } length=in.readInt(); if(length > 0) { buffer=new byte[length]; in.readFully(buffer, offset=0, length); } }
protected ByteSequence tightUnmarshalByteSequence(DataInput dataIn, BooleanStream bs) throws IOException { ByteSequence rc = null; if (bs.readBoolean()) { int size = dataIn.readInt(); byte[] t = new byte[size]; dataIn.readFully(t); return new ByteSequence(t, 0, size); } return rc; }
protected byte[] looseUnmarshalByteArray(DataInput dataIn) throws IOException { byte rc[] = null; if (dataIn.readBoolean()) { int size = dataIn.readInt(); rc = new byte[size]; dataIn.readFully(rc); } return rc; }
@Override public void readFields(DataInput in) throws IOException { version = in.readLong(); boolean hasMethods = in.readBoolean(); if (hasMethods) { int numMethods = in.readInt(); methods = new int[numMethods]; for (int i=0; i<numMethods; i++) { methods[i] = in.readInt(); } } }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); ProducerInfo info = (ProducerInfo)o; info.setProducerId((org.apache.activemq.command.ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); if (bs.readBoolean()) { short size = dataIn.readShort(); org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size]; for( int i=0; i < size; i++ ) { value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); } info.setBrokerPath(value); } else { info.setBrokerPath(null); } info.setDispatchAsync(bs.readBoolean()); info.setWindowSize(dataIn.readInt()); }
private AnnotationHolder readAnnotation(DataInput input) throws IOException { AnnotationHolder annotation = new AnnotationHolder(symbolTable.at(input.readInt())); int valueCount = input.readShort(); for (int i = 0; i < valueCount; ++i) { String name = symbolTable.at(input.readInt()); AnnotationValue value = readAnnotationValue(input); annotation.getValues().put(name, value); } return annotation; }
protected long readId(DataInput in, byte idType) throws IOException { switch (idType) { case ID_ONE_BYTE: return in.readByte() - Byte.MIN_VALUE; case ID_TWO_BYTES: return in.readShort() - Short.MIN_VALUE; case ID_FOUR_BYTES: return in.readInt() - Integer.MIN_VALUE; case ID_EIGHT_BYTES: return in.readLong() - Long.MIN_VALUE; default: throw new Error("Unknown idType " + idType); } }
protected ByteSequence looseUnmarshalByteSequence(DataInput dataIn) throws IOException { ByteSequence rc = null; if (dataIn.readBoolean()) { int size = dataIn.readInt(); byte[] t = new byte[size]; dataIn.readFully(t); rc = new ByteSequence(t, 0, size); } return rc; } }
public long tightUnmarshalLong(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException { if (bs.readBoolean()) { if (bs.readBoolean()) { return dataIn.readLong(); } else { return toLong(dataIn.readInt()); } } else { if (bs.readBoolean()) { return toLong(dataIn.readShort()); } else { return 0; } } }