com.vividsolutions.jts.io

Class ByteArrayInStream

Implemented Interfaces:
InStream

public class ByteArrayInStream
extends java.lang.Object
implements InStream

Allows an array of bytes to be used as an InStream. To optimize memory usage, instances can be reused with different byte arrays.

Constructor Summary

ByteArrayInStream(byte[] byteBuffer)

Method Summary

void
read(byte[] buf)
Reads buf.length bytes from the input stream and stores them in the supplied buffer.
void
setBuffer(byte[] byteBuffer)

Constructor Details

ByteArrayInStream

public ByteArrayInStream(byte[] byteBuffer)

Method Details

read

public void read(byte[] buf)
            throws IOException
Reads buf.length bytes from the input stream and stores them in the supplied buffer.
Specified by:
read in interface InStream
Parameters:
buf - the buffer to receive the bytes

setBuffer

public void setBuffer(byte[] byteBuffer)