public LittleEndianOutput CreateDelayedOutput(int size)
 {
     CheckPosition(size);
     LittleEndianOutput result = new LittleEndianByteArrayOutputStream(_buf, _writeIndex, size);
     _writeIndex += size;
     return result;
 }
 public override int Serialize(int offset, byte[] data)
 {
     LittleEndianOutput leo = new LittleEndianByteArrayOutputStream(data, offset);
     ContinuableRecordOutput out1 = new ContinuableRecordOutput(leo, this.Sid);
     Serialize(out1);
     out1.Terminate();
     return out1.TotalSize;
 }
        public LittleEndianOutput CreateDelayedOutput(int size)
        {
            CheckPosition(size);
            LittleEndianOutput result = new LittleEndianByteArrayOutputStream(_buf, _writeIndex, size);

            _writeIndex += size;
            return(result);
        }
Example #4
0
 public override int Serialize(int offset, byte[] data)
 {
     int dataSize = DataSize;
     int recSize = 4 + dataSize;
     LittleEndianByteArrayOutputStream out1 = new LittleEndianByteArrayOutputStream(data, offset, recSize);
     out1.WriteShort(this.Sid);
     out1.WriteShort(dataSize);
     Serialize(out1);
     if (out1.WriteIndex - offset != recSize)
     {
         throw new InvalidOperationException("Error in serialization of (" + this.GetType().Name + "): "
                 + "Incorrect number of bytes written - expected "
                 + recSize + " but got " + (out1.WriteIndex - offset));
     }
     return recSize;
 }
Example #5
0
 public int Serialize(int offset, byte[] data)
 {
     LittleEndianByteArrayOutputStream out1 = new LittleEndianByteArrayOutputStream(data, offset,this.RecordSize);
     int result=this.Serialize(out1);
     if (out1.WriteIndex - offset != this.RecordSize)
     {
         throw new InvalidOperationException("Error in serialization of (" + this.GetType().Name + "): "
                 + "Incorrect number of bytes written - expected "
                 + this.RecordSize + " but got " + (out1.WriteIndex - offset));
     }
     return result;
 }