public int calcSerializedSize() { NullDataOutputStream dos = new NullDataOutputStream(); try { toData(dos); return dos.size(); } catch (IOException ex) { RuntimeException ex2 = new IllegalArgumentException(LocalizedStrings.InitialImageOperation_COULD_NOT_CALCULATE_SIZE_OF_OBJECT.toLocalizedString()); ex2.initCause(ex); throw ex2; } } @Override
/** * Writes a <code>boolean</code> value to this output stream. * If the argument <code>v</code> * is <code>true</code>, the value <code>(byte)1</code> * is written; if <code>v</code> is <code>false</code>, * the value <code>(byte)0</code> is written. * The byte written by this method may * be read by the <code>readBoolean</code> * method of interface <code>DataInput</code>, * which will then return a <code>boolean</code> * equal to <code>v</code>. * * @param v the boolean to be written. * @exception IOException if an I/O error occurs. */ public final void writeBoolean(boolean v) throws IOException { write(v ? 1 : 0); }
public int calcSerializedSize(final NullDataOutputStream dos) { dos.reset(); try { toData(dos); return dos.size(); } catch (IOException ex) { RuntimeException ex2 = new IllegalArgumentException(LocalizedStrings.InitialImageOperation_COULD_NOT_CALCULATE_SIZE_OF_OBJECT.toLocalizedString()); ex2.initCause(ex); throw ex2; } } @Override
.create("region"); DataSerializer.writeObject(new TestPdx("a"), new NullDataOutputStream());
final NullDataOutputStream countingStream = new NullDataOutputStream(); if (InitialImageOperation.internalDuringPackingImage != null && getFullPath().endsWith(
/** * Return length of this value in bytes. */ @Override public int getLengthInBytes(final DataTypeDescriptor dtd) throws StandardException { if (!isNull()) { NullDataOutputStream ndos = new NullDataOutputStream(); try { toDataForOptimizedResultHolder(ndos); } catch (IOException ioe) { throw GemFireXDRuntimeException.newRuntimeException( "Exception in UserType.getLengthInBytes.", ioe); } return ndos.size(); } return 0; }
/** * Writes a <code>boolean</code> value to this output stream. * If the argument <code>v</code> * is <code>true</code>, the value <code>(byte)1</code> * is written; if <code>v</code> is <code>false</code>, * the value <code>(byte)0</code> is written. * The byte written by this method may * be read by the <code>readBoolean</code> * method of interface <code>DataInput</code>, * which will then return a <code>boolean</code> * equal to <code>v</code>. * * @param v the boolean to be written. * @exception IOException if an I/O error occurs. */ public final void writeBoolean(boolean v) throws IOException { write(v ? 1 : 0); }
/** * Return length of this value in bytes. */ @Override public int getLengthInBytes(final DataTypeDescriptor dtd) throws StandardException { if (!isNull()) { NullDataOutputStream ndos = new NullDataOutputStream(); try { toDataForOptimizedResultHolder(ndos); } catch (IOException ioe) { throw GemFireXDRuntimeException.newRuntimeException( "Exception in UserType.getLengthInBytes.", ioe); } return ndos.size(); } return 0; }
/** * Writes to the output stream the eight low- * order bits of the argument <code>v</code>. * The 24 high-order bits of <code>v</code> * are ignored. (This means that <code>writeByte</code> * does exactly the same thing as <code>write</code> * for an integer argument.) The byte written * by this method may be read by the <code>readByte</code> * method of interface <code>DataInput</code>, * which will then return a <code>byte</code> * equal to <code>(byte)v</code>. * * @param v the byte value to be written. * @exception IOException if an I/O error occurs. */ public final void writeByte(int v) throws IOException { write(v); }
/** * Return length of this value in bytes. */ @Override public int getLengthInBytes(final DataTypeDescriptor dtd) throws StandardException { if (!isNull()) { NullDataOutputStream ndos = new NullDataOutputStream(); try { toDataForOptimizedResultHolder(ndos); } catch (IOException ioe) { throw GemFireXDRuntimeException.newRuntimeException( "Exception in UserType.getLengthInBytes.", ioe); } return ndos.size(); } return 0; }
/** * Writes to the output stream the eight low- * order bits of the argument <code>v</code>. * The 24 high-order bits of <code>v</code> * are ignored. (This means that <code>writeByte</code> * does exactly the same thing as <code>write</code> * for an integer argument.) The byte written * by this method may be read by the <code>readByte</code> * method of interface <code>DataInput</code>, * which will then return a <code>byte</code> * equal to <code>(byte)v</code>. * * @param v the byte value to be written. * @exception IOException if an I/O error occurs. */ public final void writeByte(int v) throws IOException { write(v); }
} else { result = 4; NullDataOutputStream dos = new NullDataOutputStream(); try { DataSerializer.writeObject(o, dos); result += dos.size(); } catch (IOException ex) { RuntimeException ex2 = new IllegalArgumentException(LocalizedStrings.CachedDeserializableFactory_COULD_NOT_CALCULATE_SIZE_OF_OBJECT.toLocalizedString());
} else { result = 4; NullDataOutputStream dos = new NullDataOutputStream(); try { DataSerializer.writeObject(o, dos); result += dos.size(); } catch (IOException ex) { RuntimeException ex2 = new IllegalArgumentException(LocalizedStrings.CachedDeserializableFactory_COULD_NOT_CALCULATE_SIZE_OF_OBJECT.toLocalizedString());
} else if (calcSerializedSize) { result = Sizeable.PER_OBJECT_OVERHEAD + 4; NullDataOutputStream dos = new NullDataOutputStream(); try { DataSerializer.writeObject(o, dos); result += dos.size(); } catch (IOException ex) { RuntimeException ex2 = new IllegalArgumentException(LocalizedStrings.CachedDeserializableFactory_COULD_NOT_CALCULATE_SIZE_OF_OBJECT.toLocalizedString());
} else if (calcSerializedSize) { result = Sizeable.PER_OBJECT_OVERHEAD + 4; NullDataOutputStream dos = new NullDataOutputStream(); try { DataSerializer.writeObject(o, dos); result += dos.size(); } catch (IOException ex) { RuntimeException ex2 = new IllegalArgumentException(LocalizedStrings.CachedDeserializableFactory_COULD_NOT_CALCULATE_SIZE_OF_OBJECT.toLocalizedString());