/** * Sets whether or not a * <code>DataOutputStream</code>/<code>DataOutputStream</code> * should be used to send/receive data. public void setUseDataStream (boolean useDataStream) { this.useDataStream = useDataStream; } */ /* * Adds a new part to this message that contains a <code>byte</code> * array (as opposed to a serialized object). * * @see #addPart(byte[], boolean) */ public void addBytesPart(byte[] newPart) { addRawPart(newPart, false); }
/** * Sets whether or not a * <code>DataOutputStream</code>/<code>DataOutputStream</code> * should be used to send/receive data. public void setUseDataStream (boolean useDataStream) { this.useDataStream = useDataStream; } */ /* * Adds a new part to this message that contains a <code>byte</code> * array (as opposed to a serialized object). * * @see #addPart(byte[], boolean) */ public void addBytesPart(byte[] newPart) { addRawPart(newPart, false); }
/** * Like addObjPart(Object) but also prefers to reference * objects in the part instead of copying them into a byte buffer. */ public void addObjPartNoCopying(Object o) { if (o == null || o instanceof byte[]) { addRawPart((byte[])o, false); } else { serializeAndAddPartNoCopying(o); } } public void addObjPart(Object o, boolean zipValues) {
public void addObjPart(Object o, boolean zipValues) { if (o == null || o instanceof byte[]) { addRawPart((byte[])o, false); } else { serializeAndAddPart(o, zipValues); } } public void addPartInAnyForm(@Unretained Object o, boolean isObject) {
/** * @throws com.gemstone.gemfire.SerializationException if serialization fails */ public CloseConnectionOpImpl(LogWriterI18n lw, boolean keepAlive) { super(lw, MessageType.CLOSE_CONNECTION, 1); getMessage().addRawPart(new byte[]{(byte)(keepAlive?1:0)}, false); } @Override
public void addObjPart(Object o, boolean zipValues) { if (o == null || o instanceof byte[]) { addRawPart((byte[])o, false); } else { serializeAndAddPart(o, zipValues); } }
/** * @throws com.gemstone.gemfire.SerializationException if serialization fails */ public CloseConnectionOpImpl(boolean keepAlive) { super(MessageType.CLOSE_CONNECTION, 1); getMessage().addRawPart(new byte[]{(byte)(keepAlive?1:0)}, false); } @Override
public void addPartInAnyForm(@Unretained Object o, boolean isObject) { if (o == null) { addRawPart((byte[])o, false); } else if (o instanceof byte[]) { addRawPart((byte[])o, isObject); } else if (o instanceof StoredObject) { // It is possible it is an off-heap StoredObject that contains a simple non-object byte[]. this.messageModified = true; Part part = partsList[this.currentPart]; part.setPartState((StoredObject)o, isObject); this.currentPart++; } else { serializeAndAddPart(o, false); } }
public void addStringPart(String str) { if (str==null) { addRawPart((byte[])null, false); } else { HeapDataOutputStream hdos = new HeapDataOutputStream(str); this.messageModified = true; Part part = partsList[this.currentPart]; part.setPartState(hdos, false); this.currentPart++; } }
public void addStringPart(String str) { if (str==null) { addRawPart((byte[])null, false); } else { HeapDataOutputStream hdos = new HeapDataOutputStream(str); this.messageModified = true; Part part = partsList[this.currentPart]; part.setPartState(hdos, false); this.currentPart++; } }
Object cdValue = ((CachedDeserializable)value).getValue(); if (cdValue instanceof byte[]) { getMessage().addRawPart((byte[])cdValue, true); } else { getMessage().addObjPart(cdValue);
Object cdValue = ((CachedDeserializable)value).getValue(); if (cdValue instanceof byte[]) { getMessage().addRawPart((byte[])cdValue, true); } else { getMessage().addObjPart(cdValue);
protected static void writeResponseWithRefreshMetadata(Object data, Object callbackArg, Message origMsg, boolean isObject, ServerConnection servConn, PartitionedRegion pr, byte nwHop) throws IOException { Message responseMsg = servConn.getResponseMessage(); responseMsg.setMessageType(MessageType.RESPONSE); responseMsg.setTransactionId(origMsg.getTransactionId()); if (callbackArg == null) { responseMsg.setNumberOfParts(2); } else { responseMsg.setNumberOfParts(3); } if (data instanceof byte[]) { responseMsg.addRawPart((byte[])data, isObject); } else { Assert.assertTrue(isObject, "isObject should be true when value is not a byte[]"); responseMsg.addObjPart(data, zipValues); } if (callbackArg != null) { responseMsg.addObjPart(callbackArg); } responseMsg.addBytesPart(new byte[]{pr.getMetadataVersion().byteValue(),nwHop}); servConn.getCache().getCancelCriterion().checkCancelInProgress(null); responseMsg.send(servConn); origMsg.flush(); }
protected static void writeResponseWithRefreshMetadata(Object data, Object callbackArg, Message origMsg, boolean isObject, ServerConnection servConn, PartitionedRegion pr, byte nwHop) throws IOException { Message responseMsg = servConn.getResponseMessage(); responseMsg.setMessageType(MessageType.RESPONSE); responseMsg.setTransactionId(origMsg.getTransactionId()); if (callbackArg == null) { responseMsg.setNumberOfParts(2); } else { responseMsg.setNumberOfParts(3); } if (data instanceof byte[]) { responseMsg.addRawPart((byte[])data, isObject); } else { Assert.assertTrue(isObject, "isObject should be true when value is not a byte[]"); responseMsg.addObjPart(data, zipValues); } if (callbackArg != null) { responseMsg.addObjPart(callbackArg); } responseMsg.addBytesPart(new byte[]{pr.getMetadataVersion().byteValue(),nwHop}); servConn.getCache().getCancelCriterion().checkCancelInProgress(null); responseMsg.send(servConn); origMsg.clearParts(); }
responseMsg.addRawPart((byte[])data, isObject);
protected static void writeResponse(Object data, Object callbackArg, Message origMsg, boolean isObject, ServerConnection servConn) throws IOException { Message responseMsg = servConn.getResponseMessage(); responseMsg.setMessageType(MessageType.RESPONSE); responseMsg.setTransactionId(origMsg.getTransactionId()); if (callbackArg == null) { responseMsg.setNumberOfParts(1); } else { responseMsg.setNumberOfParts(2); } if (data instanceof byte[]) { responseMsg.addRawPart((byte[])data, isObject); } else { Assert.assertTrue(isObject, "isObject should be true when value is not a byte[]"); responseMsg.addObjPart(data, zipValues); } if (callbackArg != null) { responseMsg.addObjPart(callbackArg); } servConn.getCache().getCancelCriterion().checkCancelInProgress(null); responseMsg.send(servConn); origMsg.flush(); }
protected static void writeResponse(Object data, Object callbackArg, Message origMsg, boolean isObject, ServerConnection servConn) throws IOException { Message responseMsg = servConn.getResponseMessage(); responseMsg.setMessageType(MessageType.RESPONSE); responseMsg.setTransactionId(origMsg.getTransactionId()); if (callbackArg == null) { responseMsg.setNumberOfParts(1); } else { responseMsg.setNumberOfParts(2); } if (data instanceof byte[]) { responseMsg.addRawPart((byte[])data, isObject); } else { Assert.assertTrue(isObject, "isObject should be true when value is not a byte[]"); responseMsg.addObjPart(data, zipValues); } if (callbackArg != null) { responseMsg.addObjPart(callbackArg); } servConn.getCache().getCancelCriterion().checkCancelInProgress(null); responseMsg.send(servConn); origMsg.clearParts(); }
responseMsg.addRawPart((byte[])data, isObject);
byte valueIsObject = event.getValueIsObject();; getMessage().addRawPart(value, (valueIsObject != 0x00));
Object cdValue = ((CachedDeserializable)value).getValue(); if (cdValue instanceof byte[]) { getMessage().addRawPart((byte[])cdValue, true);