APIdia Launch Partner
Top Description Constructors Methods
sun.security.jgss

public abstract Class GSSToken

extends Object
Class Inheritance
Known Direct Subclasses
sun.security.jgss.krb5.Krb5Token, sun.security.jgss.spnego.SpNegoToken
Imports
java.io.EOFException, .IOException, .InputStream, .OutputStream

Utilities for processing GSS Tokens.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final String
getHexBytes(byte[] bytes)

public static final String
getHexBytes(byte[] bytes, int len)

public static final String
getHexBytes(byte[] bytes, int pos, int len)

public static final int
readBigEndian(byte[] data, int pos, int size)

public static final void
readFully(InputStream
the InputStream to read from
is
,
byte[]
the buffer to store the bytes into
buffer
)

Blocks till the required number of bytes have been read from the input stream.

public static final void
readFully(InputStream
the InputStream to read from
is
,
byte[]
the buffer to store the bytes into
buffer
,
int
the offset to start storing at
offset
,
int
the number of bytes to read
len
)

Blocks till the required number of bytes have been read from the input stream.

public static final int

Returns:

the integer value
readInt
(InputStream
the InputStream to read from
is
)

Reads a two byte integer value from an InputStream.

public static final int

Returns:

the integer value
readInt
(byte[]
the byte array to read from
src
,
int
the offset to start reading from
pos
)

Reads a two byte integer value from a byte array.

public static final int

Returns:

the integer value
readLittleEndian
(byte[]
the array containing the bytes of the integer value
data
,
int
the offset in the array
pos
,
int
the number of bytes to read from the array.
size
)

Reads an integer value from a byte array in little endian form.

public static final void
writeBigEndian(int value, byte[] array)

public static final void
writeBigEndian(int value, byte[] array, int pos)

public static final void
writeInt(int
the integer value. It will lose the high-order two bytes.
val
,
OutputStream
the OutputStream to write to
os
)

Writes a two byte integer value to a OutputStream.

public static final int
writeInt(int
the integer value. It will lose the high-order two bytes.
val
,
byte[]
the byte array to write to
dest
,
int
the offset to start writing to
pos
)

Writes a two byte integer value to a byte array.

public static final void
writeLittleEndian(int
the integer value to write
value
,
byte[]
the byte array into which the integer must be copied. It is assumed that the array will be large enough to hold the 4 bytes of the integer.
array
)

Copies an integer value to a byte array in little endian form.

public static final void
writeLittleEndian(int
the integer value to write
value
,
byte[]
the byte array into which the integer must be copied. It is assumed that the array will be large enough to hold the 4 bytes of the integer.
array
,
int
the position at which to start writing
pos
)

Copies an integer value to a byte array in little endian form.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

GSSTokenback to summary
public GSSToken()

Method Detail

getHexBytesback to summary
public static final String getHexBytes(byte[] bytes)
getHexBytesback to summary
public static final String getHexBytes(byte[] bytes, int len)
getHexBytesback to summary
public static final String getHexBytes(byte[] bytes, int pos, int len)
readBigEndianback to summary
public static final int readBigEndian(byte[] data, int pos, int size)
readFullyback to summary
public static final void readFully(InputStream is, byte[] buffer) throws IOException

Blocks till the required number of bytes have been read from the input stream.

Parameters
is:InputStream

the InputStream to read from

buffer:byte[]

the buffer to store the bytes into

Exceptions
IOException:
is an error occurs while reading
EOFException:
if EOF is reached before all bytes are read.
readFullyback to summary
public static final void readFully(InputStream is, byte[] buffer, int offset, int len) throws IOException

Blocks till the required number of bytes have been read from the input stream.

Parameters
is:InputStream

the InputStream to read from

buffer:byte[]

the buffer to store the bytes into

offset:int

the offset to start storing at

len:int

the number of bytes to read

Exceptions
IOException:
is an error occurs while reading
EOFException:
if EOF is reached before all bytes are read.
readIntback to summary
public static final int readInt(InputStream is) throws IOException

Reads a two byte integer value from an InputStream.

Parameters
is:InputStream

the InputStream to read from

Returns:int

the integer value

Exceptions
IOException:
if some errors occurs while reading the integer bytes.
readIntback to summary
public static final int readInt(byte[] src, int pos)

Reads a two byte integer value from a byte array.

Parameters
src:byte[]

the byte array to read from

pos:int

the offset to start reading from

Returns:int

the integer value

readLittleEndianback to summary
public static final int readLittleEndian(byte[] data, int pos, int size)

Reads an integer value from a byte array in little endian form. This method allows the reading of two byte values as well as four bytes values both of which are needed in the Kerberos v5 GSS-API mechanism.

Parameters
data:byte[]

the array containing the bytes of the integer value

pos:int

the offset in the array

size:int

the number of bytes to read from the array.

Returns:int

the integer value

writeBigEndianback to summary
public static final void writeBigEndian(int value, byte[] array)
writeBigEndianback to summary
public static final void writeBigEndian(int value, byte[] array, int pos)
writeIntback to summary
public static final void writeInt(int val, OutputStream os) throws IOException

Writes a two byte integer value to a OutputStream.

Parameters
val:int

the integer value. It will lose the high-order two bytes.

os:OutputStream

the OutputStream to write to

Exceptions
IOException:
if an error occurs while writing to the OutputStream
writeIntback to summary
public static final int writeInt(int val, byte[] dest, int pos)

Writes a two byte integer value to a byte array.

Parameters
val:int

the integer value. It will lose the high-order two bytes.

dest:byte[]

the byte array to write to

pos:int

the offset to start writing to

writeLittleEndianback to summary
public static final void writeLittleEndian(int value, byte[] array)

Copies an integer value to a byte array in little endian form.

Parameters
value:int

the integer value to write

array:byte[]

the byte array into which the integer must be copied. It is assumed that the array will be large enough to hold the 4 bytes of the integer.

writeLittleEndianback to summary
public static final void writeLittleEndian(int value, byte[] array, int pos)

Copies an integer value to a byte array in little endian form.

Parameters
value:int

the integer value to write

array:byte[]

the byte array into which the integer must be copied. It is assumed that the array will be large enough to hold the 4 bytes of the integer.

pos:int

the position at which to start writing