| java.lang.Object org.apache.harmony.pack200.Codec org.apache.harmony.pack200.BHSDCodec
BHSDCodec | final public class BHSDCodec extends Codec (Code) | | TODO Comment -- quite a lot can be nicked from Codec, since this was created
from it
|
Constructor Summary | |
public | BHSDCodec(int b, int h) Constructs an unsigned, non-delta Codec with the given B and H values. | public | BHSDCodec(int b, int h, int s) Constructs a non-delta Codec with the given B, H and S values. | public | BHSDCodec(int b, int h, int s, int d) Constructs a Codec with the given B, H, S and D values. |
Method Summary | |
public long | cardinality() Returns the cardinality of this codec; that is, the number of distinct
values that it can contain. | public long | decode(InputStream in) | public long | decode(InputStream in, long last) | public byte[] | encode(long value, long last) | public boolean | encodes(long value) | public int | getB() | public int | getH() | public int | getL() | public boolean | isDelta() | public boolean | isSigned() | public long | largest() Returns the largest value that this codec can represent. | public long | smallest() Returns the smallest value that this codec can represent. | public String | toString() Returns the codec in the form (1,256) or (1,64,1,1). |
BHSDCodec | public BHSDCodec(int b, int h)(Code) | | Constructs an unsigned, non-delta Codec with the given B and H values.
Parameters: b - the maximum number of bytes that a value can be encoded as[1..5] Parameters: h - the radix of the encoding [1..256] |
BHSDCodec | public BHSDCodec(int b, int h, int s)(Code) | | Constructs a non-delta Codec with the given B, H and S values.
Parameters: b - the maximum number of bytes that a value can be encoded as[1..5] Parameters: h - the radix of the encoding [1..256] Parameters: s - whether the encoding represents signed numbers (s=0 isunsigned; s=1 is signed with 1s complement; s=2 is signed with ?) |
BHSDCodec | public BHSDCodec(int b, int h, int s, int d)(Code) | | Constructs a Codec with the given B, H, S and D values.
Parameters: b - the maximum number of bytes that a value can be encoded as[1..5] Parameters: h - the radix of the encoding [1..256] Parameters: s - whether the encoding represents signed numbers (s=0 isunsigned; s=1 is signed with 1s complement; s=2 is signed with ?) Parameters: d - whether this is a delta encoding (d=0 is non-delta; d=1 isdelta) |
cardinality | public long cardinality()(Code) | | Returns the cardinality of this codec; that is, the number of distinct
values that it can contain.
the cardinality of this codec |
encodes | public boolean encodes(long value)(Code) | | True if this encoding can code the given value
Parameters: value - the value to check true if the encoding can encode this value |
getB | public int getB()(Code) | | the b |
getH | public int getH()(Code) | | the h |
getL | public int getL()(Code) | | the l |
isDelta | public boolean isDelta()(Code) | | Returns true if this codec is a delta codec
true if this codec is a delta codec |
isSigned | public boolean isSigned()(Code) | | Returns true if this codec is a signed codec
true if this codec is a signed codec |
largest | public long largest()(Code) | | Returns the largest value that this codec can represent.
the largest value that this codec can represent. |
smallest | public long smallest()(Code) | | Returns the smallest value that this codec can represent.
the smallest value that this codec can represent. |
toString | public String toString()(Code) | | Returns the codec in the form (1,256) or (1,64,1,1). Note that trailing
zero fields are not shown.
|
|
|