public abstract class

GSSToken

extends Object
java.lang.Object
   ↳ sun.security.jgss.GSSToken
Known Direct Subclasses

Class Overview

Utilities for processing GSS Tokens.

Summary

Public Constructors
GSSToken()
Public Methods
final static void debug(String str)
final static String getHexBytes(byte[] bytes, int len)
final static String getHexBytes(byte[] bytes)
final static String getHexBytes(byte[] bytes, int pos, int len)
final static int readBigEndian(byte[] data, int pos, int size)
final static void readFully(InputStream is, byte[] buffer, int offset, int len)
Blocks till the required number of bytes have been read from the input stream.
final static void readFully(InputStream is, byte[] buffer)
Blocks till the required number of bytes have been read from the input stream.
final static int readInt(InputStream is)
Reads a two byte integer value from an InputStream.
final static int readInt(byte[] src, int pos)
Reads a two byte integer value from a byte array.
final static int readLittleEndian(byte[] data, int pos, int size)
Reads an integer value from a byte array in little endian form.
final static void writeBigEndian(int value, byte[] array, int pos)
final static void writeBigEndian(int value, byte[] array)
final static int writeInt(int val, byte[] dest, int pos)
Writes a two byte integer value to a byte array.
final static void writeInt(int val, OutputStream os)
Writes a two byte integer value to a OutputStream.
final static void writeLittleEndian(int value, byte[] array, int pos)
Copies an integer value to a byte array in little endian form.
final static void writeLittleEndian(int value, byte[] array)
Copies an integer value to a byte array in little endian form.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GSSToken ()

Public Methods

public static final void debug (String str)

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

public static final String getHexBytes (byte[] bytes)

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 is, byte[] buffer, int offset, int len)

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

Parameters
is the InputStream to read from
buffer the buffer to store the bytes into
offset the offset to start storing at
len the number of bytes to read
Throws
IOException is an error occurs while reading

public static final void readFully (InputStream is, byte[] buffer)

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

Parameters
is the InputStream to read from
buffer the buffer to store the bytes into
Throws
IOException is an error occurs while reading

public static final int readInt (InputStream is)

Reads a two byte integer value from an InputStream.

Parameters
is the InputStream to read from
Throws
IOException if some errors occurs while reading the integer bytes.

public static final int readInt (byte[] src, int pos)

Reads a two byte integer value from a byte array.

Parameters
src the byte arra to read from
pos the offset to start reading from

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 the array containing the bytes of the integer value
pos the offset in the array
Returns
  • the integer value

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

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

public static final int writeInt (int val, byte[] dest, int pos)

Writes a two byte integer value to a byte array.

Parameters
val the integer value. It will lose the high-order two bytes.
dest the byte array to write to
pos the offset to start writing to

public static final void writeInt (int val, OutputStream os)

Writes a two byte integer value to a OutputStream.

Parameters
val the integer value. It will lose the high-order two bytes.
os the OutputStream to write to
Throws
IOException if an error occurs while writing to the OutputStream

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 the integer value to write
array 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 the position at which to start writing

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

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

Parameters
value the integer value to write
array 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.