You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



All Packages  This Package  Class Hierarchy  Class Search  Index

Class grendel.storage.ByteString

java.lang.Object
   |
   +----grendel.storage.ByteString

Represents a set of bytes. This is a spiritual cousin of String, but without the misfeature that characters are two bytes each, and there are 16 bytes of extranious object header. Since we store message headers internally in their on-the-wire form, and that is 7-bit ASCII (and occasionally 8-bit if people are being nonstandard) this is a much more tolerable representation.

This class doesn't provide all of the utilities that String does, but that's pretty much just because I didn't need them (yet?)

this is used by ByteStringTable to uniqueify the strings, to further reduce memory usage.

See Also: ByteStringTable, MessageID


class  ByteString
     extends java.lang.Object
{
          // Fields 1
     protected byte[] bytes;

          // Constructors 2
     ByteString(byte[]);
     ByteString(ByteBuf);

          // Methods 6
     public boolean equals(Object);
     protected int hashBytes(byte[], int, int);
     public int hashCode();
     public ByteBuf toByteBuf();
     public byte[] toBytes();
     public String toString();
}



Fields


bytes

   protected byte[] bytes



Constructors


ByteString

   ByteString(byte[] bytes) 


ByteString

   ByteString(ByteBuf buf) 



Methods


toString

   public String toString() 
Overrides:
toString in class Object


toByteBuf

   public ByteBuf toByteBuf() 


toBytes

   public byte[] toBytes() 


hashBytes

   protected int hashBytes(byte[] b, 
                           int start, 
                           int len) 


hashCode

   public int hashCode() 
Overrides:
hashCode in class Object


equals

   public boolean equals(Object x) 
Overrides:
equals in class Object


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4