Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Transport

The transport package offers utilities for handling OSID data streams.

Table of Contents

ByteBufferDataInputStream

ByteBufferDataInputStream is an implementation of osid.transport.DataInputStream based on a java.nio.ByteBuffer. The java.nio.ByteBuffer should be flipped so the ByteBufferDataInputStream can read it. The ByteBufferDataInputStream will consume the buffer given to it. If the caller wishes to retain the buffer for other purposes, it should pass in a duplicate buffer.

Code Block
try {
    java.io.File imageFile = new java.io.File("picture.jpg");
    java.awt.image.BufferedImage img = javax.imageio.ImageIO.read(imageFile);