Exemplo n.º 1
0
 public PlainBufferRow(List <PlainBufferCell> primaryKey, List <PlainBufferCell> cells, bool hasDeleteMarker)
 {
     this.primaryKey      = primaryKey;
     this.cells           = cells;
     this.hasDeleteMarker = hasDeleteMarker;
     this.extension       = new PlainBufferExtension();
 }
        public PlainBufferExtension ReadExtension()
        {
            PlainBufferExtension extension = new PlainBufferExtension();

            if (CheckLastTagWas(PlainBufferConsts.TAG_EXTENSION))
            {
                ReadUInt32(); // length
                ReadTag();
                while (PlainBufferConsts.IsTagInExtension(GetLastTag()))
                {
                    if (CheckLastTagWas(PlainBufferConsts.TAG_SEQ_INFO))
                    {
                        extension.setSequenceInfo(ReadSequenceInfo());
                    }
                    else
                    {
                        int length = (int)this.inputStream.ReadRawLittleEndian32();
                        SkipRawSize(length);
                        ReadTag();
                    }
                }
            }

            return(extension);
        }
Exemplo n.º 3
0
        public static int ComputeSkipLengthForExtensionTag(PlainBufferExtension extension)
        {
            int size = 0;

            if (extension.HasSeq())
            {
                size += 1 + PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; //TAG_SEQ_ING + length
                size += ComputeSkipLengthForSequenceInfo();
            }

            return(size);
        }
Exemplo n.º 4
0
        public static int ComputePlainBufferExtension(PlainBufferExtension extension)
        {
            int size = 1;                                          //TAG_EXTENSION

            size += PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; // Length
            if (extension.HasSeq())
            {
                size += ComputePlainBufferSequenceInfo();
            }

            return(size);
        }
        public void WriteExtension(PlainBufferExtension extension)
        {
            WriteTag(PlainBufferConsts.TAG_EXTENSION);
            output.WriteRawLittleEndian32(PlainBufferBuilder.ComputeSkipLengthForExtensionTag(extension));
            int extensionCount = 0;

            if (extension.HasSeq())
            {
                WriteSequenceInfo(extension.GetSequenceInfo());
                extensionCount++;
            }

            if (extensionCount == 0)
            {
                throw new IOException("no extension tag is Writen.");
            }
        }
Exemplo n.º 6
0
 public void SetExtension(PlainBufferExtension extension)
 {
     this.extension = extension;
 }