Uploaded image for project: 'ProtoStream'
  1. ProtoStream
  2. IPROTO-129

ProtobufUtil.fromWrappedByteArray should not create a ByteArrayInputStream

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.2.6.Final, 4.3.3.Final
    • 4.2.5.Final, 4.3.2.Final
    • None

      ProtobufUtil.fromWrappedByteArray wraps the bytep[] in a ByteArrayInputStream and uses that as an input for CodedInputStream. But that is inefficient, because CodedInputStream.StreamDecoder needs to allocate a buffer and copy from the stream into the buffer before processing.

      Instead we can pass the byte[] directly to CodedInputStream and use CodedInputStream.ArrayDecoder, which doesn't need a buffer.

              dberinde@redhat.com Dan Berindei (Inactive)
              dberinde@redhat.com Dan Berindei (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: