Interface IWriteable

All Known Implementing Classes:
AArrayBlob, ABlob, ABlobMap, AccountKey, AccountStatus, ACell, AClosure, ACollection, ACountable, ADataFn, ADataStructure, Address, AFn, AHashMap, AHashSet, AInteger, AList, ALongBlob, AMap, AMapEntry, AMultiOp, ANumeric, AOp, APrimitive, ARecord, ARecordGeneric, ASequence, ASet, ASignature, AString, ASymbolic, ATransaction, AVector, Belief, Blob, BlobMap, BlobTree, Block, BlockResult, Call, Cond, Constant, CoreFn, CorePred, CVMBigInteger, CVMBool, CVMChar, CVMDouble, CVMLong, Def, Do, Ed25519Signature, Fn, Hash, Invoke, Invoke, Keyword, KeywordFn, Lambda, Let, List, Local, LongBlob, Lookup, MapEntry, MapFn, MapLeaf, MapTree, Multi, MultiFn, Order, PeerStatus, Query, Ref, RefDirect, RefSoft, Result, SeqFn, Set, SetFn, SetLeaf, SetTree, SignedData, Special, State, StringShort, StringSlice, StringTree, Symbol, Syntax, Transfer, VectorArray, VectorLeaf, VectorTree

public interface IWriteable
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    encode(byte[] bs, int pos)
    Writes this object to a byte array including an appropriate message tag
    int
    Estimate the encoded data size for this Cell.
    Writes this object to a ByteBuffer including an appropriate message tag
  • Method Details

    • encode

      int encode(byte[] bs, int pos)
      Writes this object to a byte array including an appropriate message tag
      Parameters:
      bs - byte array to write this object to
      pos - position at which to write the value
      Returns:
      The updated position
    • write

      Writes this object to a ByteBuffer including an appropriate message tag
      Parameters:
      bb - ByteBuffer to write to
      Returns:
      The updated ByteBuffer
    • estimatedEncodingSize

      int estimatedEncodingSize()
      Estimate the encoded data size for this Cell. Used for quickly sizing buffers. Implementations should try to return a size that is highly likely to contain the entire object when encoded, including the tag byte. Should not traverse soft Refs, i.e. must be usable on arbitrary partial data structures
      Returns:
      The estimated size for the binary representation of this object.