Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.squawk.debugger
Class PacketInputStream

    java.lang.Object
      com.sun.squawk.debugger.PacketInputStream

    public class PacketInputStream

extends Object

A PacketInputStream is used to read data from the data part of a `Packet`.

Constructor Summary
`` | `PacketInputStream(DataInputStream dis)`
`protected` | `PacketInputStream(PacketInputStream inner)`

Method Summary
`void` | `close()` Closes this stream and its underlying stream.
`DataInputStream` | `getInputStream()` Get the underlying inputstream for sniffing purposes
`boolean` | `readBoolean(String s)` Reads a boolean value from this stream.
`byte` | `readByte(String s)` Reads one byte from this stream.
`char` | `readChar(String s)` Reads a char value from this stream.
`double` | `readDouble(String s)` Reads a double value from this stream.
`DataType.FieldID` | `readFieldID(String s)`
`float` | `readFloat(String s)` Reads a float value from this stream.
`DataType.FrameID` | `readFrameID(String s)`
`int` | `readInt(String s)` Reads an int value from this stream.
`DataType.Location` | `readLocation(String s)`
`long` | `readLong(String s)` Reads a long value from this stream.
`DataType.MethodID` | `readMethodID(String s)`
`DataType.ObjectID` | `readObjectID(String s)`
`DataType.ReferenceTypeID` | `readReferenceTypeID(String s)`
`short` | `readShort(String s)` Reads a short value from this stream.
`String` | `readString(String s)` Reads from the stream a representation of a Unicode character string encoded in Java modified UTF-8 format; this string of characters is then returned as a `String`.
`DataType.TaggedObjectID` | `readTaggedObjectID(String s)`
`int` | `skipBytes(int n)` Attempts to skip over `n` bytes in the stream.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PacketInputStream

    public PacketInputStream(DataInputStream dis)

### PacketInputStream

    protected PacketInputStream(PacketInputStream inner)

Method Detail

### getInputStream

    public final DataInputStream getInputStream()

  Get the underlying inputstream for sniffing purposes

### readByte

    public final byte readByte(String s)
                        throws IOException

  Reads one byte from this stream.

  Parameters:
    `s` - prefix to use if this read is logged. A value of null prevents logging altogether.
  Returns:
    the next byte of data, or `-1` if the end of the stream is reached.
  Throws:
    `IOException` - if there was an IO error while reading

### readBoolean

    public final boolean readBoolean(String s)
                              throws IOException

  Reads a boolean value from this stream.

  Parameters:
    `s` - prefix to use if this read is logged. A value of null prevents logging altogether.
  Returns:
    the `boolean` value read.
  Throws:
    `IOException` - if there was an IO error while reading

### readChar

    public final char readChar(String s)
                        throws IOException

  Reads a char value from this stream.

  Parameters:
    `s` - prefix to use if this read is logged. A value of null prevents logging altogether.
  Returns:
    the next two bytes of this input stream as a Unicode character.
  Throws:
    `IOException` - if there was an IO error while reading

### readShort

    public final short readShort(String s)
                          throws IOException

  Reads a short value from this stream.

  Parameters:
    `s` - prefix to use if this read is logged. A value of null prevents logging altogether.
  Returns:
    the next two bytes of this input stream, interpreted as a signed 16-bit number.
  Throws:
    `IOException` - if there was an IO error while reading

### readInt

    public final int readInt(String s)
                      throws IOException

  Reads an int value from this stream.

  Parameters:
    `s` - prefix to use if this read is logged. A value of null prevents logging altogether.
  Returns:
    the next four bytes of this input stream, interpreted as an `int`.
  Throws:
    `IOException` - if there was an IO error while reading

### readLong

    public final long readLong(String s)
                        throws IOException

  Reads a long value from this stream.

  Parameters:
    `s` - prefix to use if this read is logged. A value of null prevents logging altogether.
  Returns:
    the next eight bytes of this input stream, interpreted as a `long`.
  Throws:
    `IOException` - if there was an IO error while reading

### readFloat

    public final float readFloat(String s)
                          throws IOException

  Reads a float value from this stream.

  Parameters:
    `s` - prefix to use if this read is logged. A value of null prevents logging altogether.
  Returns:
    the read 32 bit float.
  Throws:
    `IOException` - if there was an IO error while reading

### readDouble

    public final double readDouble(String s)
                            throws IOException

  Reads a double value from this stream.

  Parameters:
    `s` - prefix to use if this read is logged. A value of null prevents logging altogether.
  Returns:
    the 64 bit double read.
  Throws:
    `IOException` - if there was an IO error while reading

### readString

    public final String readString(String s)
                            throws IOException

  Reads from the stream a representation of a Unicode character string encoded in Java modified UTF-8 format; this string of characters is then returned as a `String`. The format of the string in the stream is the same as that for `DataInput`, but the characters are preceeded by a 4-byte length field.

  Parameters:
    `s` - prefix to use if this read is logged. A value of null prevents logging altogether.
  Returns:
    a Unicode string.
  Throws:
    `IOException` - if there was an IO error while reading

### readObjectID

    public DataType.ObjectID readObjectID(String s)
                                   throws IOException

  Throws:
    `IOException`

### readTaggedObjectID

    public DataType.TaggedObjectID readTaggedObjectID(String s)
                                               throws IOException

  Throws:
    `IOException`

### readReferenceTypeID

    public DataType.ReferenceTypeID readReferenceTypeID(String s)
                                                 throws IOException

  Throws:
    `IOException`

### readMethodID

    public DataType.MethodID readMethodID(String s)
                                   throws IOException

  Throws:
    `IOException`

### readFrameID

    public DataType.FrameID readFrameID(String s)
                                 throws IOException

  Throws:
    `IOException`

### readFieldID

    public DataType.FieldID readFieldID(String s)
                                 throws IOException

  Throws:
    `IOException`

### readLocation

    public DataType.Location readLocation(String s)
                                   throws IOException

  Throws:
    `IOException`

### skipBytes

    public int skipBytes(int n)
                  throws IOException

  Attempts to skip over `n` bytes in the stream.

  Parameters:
    `n` - number of bytes to skip
  Returns:
    number of bytes actually skipped
  Throws:
    `IOException` - if there was an IO error while skipping

### close

    public void close()
               throws IOException

  Closes this stream and its underlying stream.

  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

"
For updated information see the Java FRC site
"