ucar.unidata.util
Class ByteString.Concrete

java.lang.Object
  extended by ucar.unidata.util.ByteString
      extended by 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:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.unidata.util.ByteString
ByteString.Concrete, ByteString.Empty, ByteString.SubString, ByteString.TrSubString
 
Field Summary
protected  byte[] ba_
          Storage for the data
 
Fields inherited from class ucar.unidata.util.ByteString
nada
 
Constructor Summary
  ByteString.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.
protected ByteString.Concrete(ByteString.Concrete bs, boolean share)
          Copy constuctor.
  ByteString.Concrete(ByteString bs)
          Copy constuctor.
  ByteString.Concrete(ByteString bs, int length)
          Copy constuctor which trims input to length.
  ByteString.Concrete(ByteString bs, int origin, int length)
          Copy constuctor which trims input to [origin, origin + length).
  ByteString.Concrete(String str)
          Construct a ByteString by narrowing a String.
 
Method Summary
 byte byteAt(int ii)
          _more_
 byte[] copyBytes(int srcpos, byte[] dst, int dstpos, int nbytes)
          _more_
 int getLength()
          _more_
 ByteString subByteString(int beginIndex, int length)
          _more_
 ByteString substring(int beginIndex)
          _more_
 byte[] toArray()
          _more_
 
Methods inherited from class ucar.unidata.util.ByteString
ByteToChar8859_1, charAt, CharToByte8859_1, compare, compare, compareTo, compareTo, compareTo, concat, concat, equals, equalS, format, hashCode, length, main, substring, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ba_

protected final byte[] ba_
Storage for the data

Constructor Detail

ByteString.Concrete

public ByteString.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

ByteString.Concrete

public ByteString.Concrete(ByteString bs)
Copy constuctor. Never shares storage with bs.

Parameters:
bs -

ByteString.Concrete

protected ByteString.Concrete(ByteString.Concrete bs,
                              boolean share)
Copy constuctor.

Parameters:
bs -
share -

ByteString.Concrete

public ByteString.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 -

ByteString.Concrete

public ByteString.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 -

ByteString.Concrete

public ByteString.Concrete(String str)
Construct a ByteString by narrowing a String.

Parameters:
str -
Method Detail

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:
String.substring(int)