usb.jphoto
Class Buffer

java.lang.Object
  |
  +--usb.jphoto.Buffer
Direct Known Subclasses:
Container

public class Buffer
extends java.lang.Object

A Buffer handles marshaling/unmarshaling rules applicable to PTP over USB. That's a fairly standard sort of little-endian marshaling, Unicode enabled. In this API, eight and sixteen bit values are passed in the least significant bits of integers, and are sign extended if needed. Unsigned thirty-two and sixty-four bit values are not currently provided; they have the same bit patterns as signed values, but applications must print them differently. One hundred twenty-eight bit integers are not currently supported. These buffers are not to be used concurrently.

Strings representing times (YYYYMMDDThhmmss[.s]{,Z,{+,-}hhmm}) are not currently transformed to Java-oriented representations.


Method Summary
protected  int getS16(int index)
          Unmarshals a signed 16 bit integer from a fixed buffer offset.
protected  int getS32(int index)
          Unmarshals a signed 32 bit integer from a fixed buffer offset.
protected  long getS64(int index)
          Unmarshals a signed 64 bit integer from a fixed buffer offset
protected  int getS8(int index)
          Unmarshals a signed 8 bit integer from a fixed buffer offset.
protected  java.lang.String getString(int index)
          Unmarshals a string (or null) from a fixed buffer offset.
protected  int getU16(int index)
          Unmarshals an unsigned 16 bit integer from a fixed buffer offset.
protected  int getU8(int index)
          Unmarshals an unsigned 8 bit integer from a fixed buffer offset.
protected  int nextS16()
          Unmarshals the next signed 16 bit integer
protected  int[] nextS16Array()
          Unmarshals an array of signed 16 bit integers
protected  int nextS32()
          Unmarshals the next signed 32 bit integer
protected  int[] nextS32Array()
          Unmarshals an array of signed 32 bit integers.
protected  long nextS64()
          Unmarshals the next signed 64 bit integer
protected  long[] nextS64Array()
          Unmarshals an array of signed 64 bit integers
protected  int nextS8()
          Unmarshals the next signed 8 bit integer
protected  int[] nextS8Array()
          Unmarshals an array of signed 8 bit integers
protected  java.lang.String nextString()
          Unmarshals the next string (or null).
protected  int nextU16()
          Unmarshals the next unsinged 16 bit integer
protected  int[] nextU16Array()
          Unmarshals an array of unsigned 16 bit integers
protected  int nextU8()
          Unmarshals the next unsigned 8 bit integer
protected  int[] nextU8Array()
          Unmarshals an array of 8 bit integers
protected  void put16(int value)
          Marshals a 16 bit integer (signed or unsigned)
protected  void put32(int value)
          Marshals a 32 bit integer (signed or unsigned)
protected  void put64(long value)
          Marshals a 64 bit integer (signed or unsigned)
protected  void put8(int value)
          Marshals an 8 bit integer (signed or unsigned)
protected  void putString(java.lang.String s)
          Marshals a string, of length at most 254 characters, or null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getS8

protected final int getS8(int index)
Unmarshals a signed 8 bit integer from a fixed buffer offset.

getU8

protected final int getU8(int index)
Unmarshals an unsigned 8 bit integer from a fixed buffer offset.

put8

protected final void put8(int value)
Marshals an 8 bit integer (signed or unsigned)

nextS8

protected final int nextS8()
Unmarshals the next signed 8 bit integer

nextU8

protected final int nextU8()
Unmarshals the next unsigned 8 bit integer

nextS8Array

protected final int[] nextS8Array()
Unmarshals an array of signed 8 bit integers

nextU8Array

protected final int[] nextU8Array()
Unmarshals an array of 8 bit integers

getS16

protected final int getS16(int index)
Unmarshals a signed 16 bit integer from a fixed buffer offset.

getU16

protected final int getU16(int index)
Unmarshals an unsigned 16 bit integer from a fixed buffer offset.

put16

protected final void put16(int value)
Marshals a 16 bit integer (signed or unsigned)

nextS16

protected final int nextS16()
Unmarshals the next signed 16 bit integer

nextU16

protected final int nextU16()
Unmarshals the next unsinged 16 bit integer

nextS16Array

protected final int[] nextS16Array()
Unmarshals an array of signed 16 bit integers

nextU16Array

protected final int[] nextU16Array()
Unmarshals an array of unsigned 16 bit integers

getS32

protected final int getS32(int index)
Unmarshals a signed 32 bit integer from a fixed buffer offset.

put32

protected final void put32(int value)
Marshals a 32 bit integer (signed or unsigned)

nextS32

protected final int nextS32()
Unmarshals the next signed 32 bit integer

nextS32Array

protected final int[] nextS32Array()
Unmarshals an array of signed 32 bit integers.

getS64

protected final long getS64(int index)
Unmarshals a signed 64 bit integer from a fixed buffer offset

put64

protected final void put64(long value)
Marshals a 64 bit integer (signed or unsigned)

nextS64

protected final long nextS64()
Unmarshals the next signed 64 bit integer

nextS64Array

protected final long[] nextS64Array()
Unmarshals an array of signed 64 bit integers

getString

protected final java.lang.String getString(int index)
Unmarshals a string (or null) from a fixed buffer offset.

putString

protected void putString(java.lang.String s)
Marshals a string, of length at most 254 characters, or null.

nextString

protected java.lang.String nextString()
Unmarshals the next string (or null).


Associated source code is licenced under the GPL.
See http://jphoto.sourceforge.net
This documentation was derived from that source code on 2001-04-12.