protected int tightMarshalString1(String value, BooleanStream bs) throws IOException { bs.writeBoolean(value != null); if (value != null) { int strlen = value.length(); int utflen = 0; char[] charr = new char[strlen]; int c = 0; boolean isOnlyAscii = true; value.getChars(0, strlen, charr, 0); for (int i = 0; i < strlen; i++) { c = charr[i]; if ((c >= 0x0001) && (c <= 0x007F)) { utflen++; } else if (c > 0x07FF) { utflen += 3; isOnlyAscii = false; } else { isOnlyAscii = false; utflen += 2; } } if (utflen >= Short.MAX_VALUE) { throw new IOException("Encountered a String value that is too long to encode."); } bs.writeBoolean(isOnlyAscii); return utflen + 2; } else { return 0; } }
protected int tightMarshalThrowable1(OpenWireFormat wireFormat, Throwable o, BooleanStream bs) throws IOException { if (o == null) { bs.writeBoolean(false); return 0; } else { int rc = 0; bs.writeBoolean(true); rc += tightMarshalString1(o.getClass().getName(), bs); rc += tightMarshalString1(o.getMessage(), bs); if (wireFormat.isStackTraceEnabled()) { rc += 2; StackTraceElement[] stackTrace = o.getStackTrace(); for (int i = 0; i < stackTrace.length; i++) { StackTraceElement element = stackTrace[i]; rc += tightMarshalString1(element.getClassName(), bs); rc += tightMarshalString1(element.getMethodName(), bs); rc += tightMarshalString1(element.getFileName(), bs); rc += 4; } rc += tightMarshalThrowable1(wireFormat, o.getCause(), bs); } return rc; } }
/** Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { ConnectionControl info = (ConnectionControl) o; int rc = super.tightMarshal1(wireFormat, o, bs); bs.writeBoolean(info.isClose()); bs.writeBoolean(info.isExit()); bs.writeBoolean(info.isFaultTolerant()); bs.writeBoolean(info.isResume()); bs.writeBoolean(info.isSuspend()); return rc + 0; }
protected int tightMarshalObjectArray1( OpenWireFormat wireFormat, DataStructure[] objects, BooleanStream bs) throws IOException { if (objects != null) { int rc = 0; bs.writeBoolean(true); rc += 2; for (int i = 0; i < objects.length; i++) { rc += tightMarshalNestedObject1(wireFormat, objects[i], bs); } return rc; } else { bs.writeBoolean(false); return 0; } }
protected int tightMarshalByteSequence1(ByteSequence data, BooleanStream bs) throws IOException { bs.writeBoolean(data != null); if (data != null) { return data.getLength() + 4; } else { return 0; } }
protected int tightMarshalByteArray1(byte[] data, BooleanStream bs) throws IOException { bs.writeBoolean(data != null); if (data != null) { return data.length + 4; } else { return 0; } }
protected int tightMarshalCachedObject1( OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException { if (wireFormat.isCacheEnabled()) { Short index = wireFormat.getMarshallCacheIndex(o); bs.writeBoolean(index == null); if (index == null) { int rc = wireFormat.tightMarshalNestedObject1(o, bs); wireFormat.addToMarshallCache(o); return 2 + rc; } else { return 2; } } else { return wireFormat.tightMarshalNestedObject1(o, bs); } }
/** Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { ConsumerInfo info = (ConsumerInfo) o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure) info.getConsumerId(), bs); bs.writeBoolean(info.isBrowser()); rc += tightMarshalCachedObject1(wireFormat, (DataStructure) info.getDestination(), bs); bs.writeBoolean(info.isDispatchAsync()); rc += tightMarshalString1(info.getSelector(), bs); rc += tightMarshalString1(info.getSubscriptionName(), bs); bs.writeBoolean(info.isNoLocal()); bs.writeBoolean(info.isExclusive()); bs.writeBoolean(info.isRetroactive()); rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure) info.getAdditionalPredicate(), bs); bs.writeBoolean(info.isNetworkSubscription()); bs.writeBoolean(info.isOptimizedAcknowledge()); bs.writeBoolean(info.isNoRangeAcks()); rc += tightMarshalObjectArray1(wireFormat, info.getNetworkConsumerPath(), bs); return rc + 9; }
public int tightMarshalLong1(OpenWireFormat wireFormat, long o, BooleanStream bs) throws IOException { if (o == 0) { bs.writeBoolean(false); bs.writeBoolean(false); return 0; } else if ((o & 0xFFFFFFFFFFFF0000L) == 0) { bs.writeBoolean(false); bs.writeBoolean(true); return 2; } else if ((o & 0xFFFFFFFF00000000L) == 0) { bs.writeBoolean(true); bs.writeBoolean(false); return 4; } else { bs.writeBoolean(true); bs.writeBoolean(true); return 8; } }
/**