|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ORG.oclc.ber.ASN1 | +--ORG.oclc.ber.BerString
BerString is a class for BER encoded strings.
Here is an example to read a BER record from System.in, build a DataDir tree over the BER record and write a formatted version of the DataDir tree to System.out.
BerString berRec = new BerString(System.in); DataDir dir = new DataDir(berRec); System.out.println(dir.toString());
The BER utilities are available via anonymous ftp to ftp.rsch.oclc.org and are in the pub/BER_utilities directory. They are available in either a C version (as source) or a Java version (as class files).
ASN1
,
BufferedBerStream
, Serialized FormField Summary | |
boolean |
EOFFound
|
protected boolean |
indefinite
|
protected int |
offset
|
protected byte[] |
record
|
Fields inherited from class ORG.oclc.ber.ASN1 |
APPLICATION,
arbitrary,
BITSTRING,
BOOLEAN,
CONSTRUCTED,
CONTEXT,
ENUMERATED,
EXTERNAL,
GENERALSTRING,
INTEGER,
NULL,
OBJECTDESCRIPTOR,
OBJECTIDENTIFIER,
octet_aligned,
OCTETSTRING,
PRIMITIVE,
PRIVATE,
SEQUENCE,
SET,
single_ASN1_type,
UNIVERSAL,
VISIBLESTRING |
Constructor Summary | |
BerString(byte[] record)
|
|
BerString(DataDir dir)
Build a ber_record from a directory. |
|
BerString(DataDir dir,
int extraLength,
int offset)
Build a ber_record from a directory and leave space in the buffer for other data to be provided by the application. |
|
BerString(InputStream in)
Read a ber_record from the InputStream. |
Method Summary | |
int |
asn1Len()
Find the length of a BER record. |
int |
getLen(int[] fieldlen)
Get a length directly from a BER record. |
int |
getTag()
Get a tag directly from a BER record. |
int |
getTag(int[] tagLen)
Get a tag directly from a BER record and fill in the tagLen in the incoming integer array. |
boolean |
IsCompleteBER(int len,
int[] remainder)
Determine if a complete BER record has been received. |
boolean |
IsCompleteBER(int offset,
int len,
int[] remainder)
|
void |
putChar(byte[] chars,
int length)
Put an array of bytes in to a BER record. |
void |
putChar(byte[] chars,
int toffset,
int length)
|
void |
putLen(int len)
Put a length directly into a BER record. |
void |
putNumber(long number)
Put a number into a BER record. |
void |
putTag(int fldid,
byte asn1class,
byte form)
Put a tag directly into a BER record. |
byte[] |
record()
Accessor method for byte[] record. |
void |
setOffset(int offset)
Allows caller to reset offset to beginning of record. |
String |
toString()
Creates String representation of BER record. |
String |
toString(int length)
Creates String representation of BER record. |
void |
writeBerString(OutputStream out)
Write the BerString to the OutputStream. |
Methods inherited from class ORG.oclc.ber.ASN1 |
getLong,
getNum,
lenLen,
numLen,
putNum,
tagLen |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected byte[] record
protected int offset
protected boolean indefinite
public boolean EOFFound
Constructor Detail |
public BerString(byte[] record)
public BerString(DataDir dir)
dir
- directorypublic BerString(DataDir dir, int extraLength, int offset)
int header_size = 13, trailer_size = 14; DataDir dir; // BER record you want between header & trailer BerString berRec = new BerString(dir, header_size + trailer_size, header_size);
dir
- directorylength
- additional space requestedoffset
- where to build the BER record in the new bufferpublic BerString(InputStream in) throws FileNotFoundException, IOException, EOFException
in
- InputStreamMethod Detail |
public byte[] record()
public void setOffset(int offset)
public final void writeBerString(OutputStream out) throws IOException
public final String toString()
public final String toString(int length)
length
- Truncate output to this length.public final int asn1Len()
public final int getTag()
public final int getTag(int[] tagLen)
public final int getLen(int[] fieldlen)
public final void putTag(int fldid, byte asn1class, byte form)
fldid
- fldid of tagasn1class
- class of tagform
- form of tagpublic final void putLen(int len)
length
- length to put into recordpublic final void putNumber(long number)
number
- number to putpublic final void putChar(byte[] chars, int length)
chars
- array of byteslength
- number of bytes to copy into recordpublic final void putChar(byte[] chars, int toffset, int length)
public final boolean IsCompleteBER(int len, int[] remainder)
len
- length of BER recordremainder
- number of bytes missing from record, or 0public final boolean IsCompleteBER(int offset, int len, int[] remainder)
|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |