Class ByteString.Concrete

java.lang.Object
ucar.unidata.util.ByteString
ucar.unidata.util.ByteString.Concrete
All Implemented Interfaces:
Serializable, Comparable
Direct Known Subclasses:
ByteString.TrSubString
Enclosing class:
ByteString

public static class ByteString.Concrete extends ByteString implements Serializable
Class Concrete
Version:
%I%, %G%
Author:
Unidata development team
See Also:
  • Field Details

    • ba_

      protected final byte[] ba_
      Storage for the data
  • Constructor Details

    • Concrete

      public Concrete(byte[] ba, boolean share)
      Constructs a new ByteString initialized to contain the same sequence of bytes as the contained in the byte array argument. If share is true then the byte array argument is used as backing storage. Caution: in this case, subsequent modification of the byte array affects the newly created ByteString. Otherwise, the contents of the byte array are copied and subsequent modification of the byte array does not affect the newly created ByteString.
      Parameters:
      ba - byte array which initializes contents of this
      share - boolean, if false, make a private copy of ba
    • Concrete

      public Concrete(ByteString bs)
      Copy constuctor. Never shares storage with bs.
      Parameters:
      bs -
    • Concrete

      protected Concrete(ByteString.Concrete bs, boolean share)
      Copy constuctor.
      Parameters:
      bs -
      share -
    • Concrete

      public Concrete(ByteString bs, int length)
      Copy constuctor which trims input to length. Used by subByteString and substring. Never shares storage with bs.
      Parameters:
      bs -
      length -
    • Concrete

      public Concrete(ByteString bs, int origin, int length)
      Copy constuctor which trims input to [origin, origin + length). Used by subByteString and substring. Never shares storage with bs.
      Parameters:
      bs -
      origin -
      length -
    • Concrete

      public Concrete(String str)
      Construct a ByteString by narrowing a String.
      Parameters:
      str -
  • Method Details

    • getLength

      public int getLength()
      _more_
      Specified by:
      getLength in class ByteString
      Returns:
      _more_
    • byteAt

      public byte byteAt(int ii)
      _more_
      Specified by:
      byteAt in class ByteString
      Parameters:
      ii -
      Returns:
      _more_
    • copyBytes

      public byte[] copyBytes(int srcpos, byte[] dst, int dstpos, int nbytes)
      _more_
      Overrides:
      copyBytes in class ByteString
      Parameters:
      srcpos -
      dst -
      dstpos -
      nbytes -
      Returns:
      _more_
    • toArray

      public byte[] toArray()
      _more_
      Overrides:
      toArray in class ByteString
      Returns:
      _more_
    • subByteString

      public ByteString subByteString(int beginIndex, int length)
      _more_
      Overrides:
      subByteString in class ByteString
      Parameters:
      beginIndex -
      length -
      Returns:
      _more_
    • substring

      public ByteString substring(int beginIndex)
      _more_
      Overrides:
      substring in class ByteString
      Parameters:
      beginIndex -
      Returns:
      _more_
      See Also: