Class BlobBuilder

java.lang.Object
convex.core.data.BlobBuilder

public class BlobBuilder extends Object
Similar to Java StringBuilder designed for adding small Blobs
  • Field Details

    • acc

      protected ABlob acc
    • tail

      protected byte[] tail
    • count

      protected long count
  • Constructor Details

    • BlobBuilder

      public BlobBuilder()
    • BlobBuilder

      public BlobBuilder(ABlob blob)
  • Method Details

    • append

      public BlobBuilder append(AString a)
    • append

      public BlobBuilder append(ABlob b)
    • toBlob

      public ABlob toBlob()
    • slice

      public ABlob slice(long start, long length)
      Takes a slice of the Blob currently under construction. May be more efficient than toBLob().slice(...).
      Parameters:
      start - Start index of slice
      length - Length of slice
      Returns:
      Slice of Blob under construction
    • getCVMString

      public AString getCVMString()
    • count

      public long count()
    • append

      public void append(String string)
    • append

      public BlobBuilder append(byte b)
    • append

      public BlobBuilder append(char c)
    • append

      public BlobBuilder append(CVMChar c)
      Append a CVM character to this Blob
      Parameters:
      c - CVM Character
      Returns:
      This BlobBuilder
    • check

      public boolean check(long limit)
      Checks if this BlobBuilder is less than or equal to the specified limit
      Parameters:
      limit - Maximum allowable length of BlobBuilder
      Returns:
      true if within limit, false if exceeded
    • append

      public void append(ByteBuffer bb)
      Appends remaining bytes from a ByteBuffer to this BlobBuilder
      Parameters:
      bb - ByteBuffer to append
    • clear

      public void clear()
      Clears this BlobBuilder, preparing for new appends to an empty Blob