Transport
Transport
The transport package offers utilities for handling OSID data streams.
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.
try { java.io.File imageFile = new java.io.File("picture.jpg"); java.awt.image.BufferedImage img = javax.imageio.ImageIO.read(imageFile); Â