Go to the documentation of this file.
3 package com.pixelmed.codec.jpeg;
5 import java.io.IOException;
6 import java.io.OutputStream;
8 import java.nio.ByteOrder;
24 private static final String identString =
"@(#) $Header: /userland/cvs/codec/com/pixelmed/codec/jpeg/OutputArrayOrStream.java,v 1.5 2016/01/16 13:30:09 dclunie Exp $";
26 protected OutputStream
out =
null;
27 protected ByteOrder
order =
null;
53 if (this.out !=
null || this.byteValues !=
null || this.shortValues !=
null) {
54 throw new IOException(
"Destination already allocated");
77 throw new IOException(
"Cannot assign byte order if no OutputStream");
83 if (this.out !=
null || this.byteValues !=
null || this.shortValues !=
null) {
84 throw new IOException(
"Destination already allocated");
86 this.byteValues =
new byte[length];
91 if (this.out !=
null || this.byteValues !=
null || this.shortValues !=
null) {
92 throw new IOException(
"Destination already allocated");
94 this.shortValues =
new short[length];
124 throw new IOException(
"Cannot write byte value to short array");
127 throw new IOException(
"Byte array not allocated yet");
139 if (
order == ByteOrder.LITTLE_ENDIAN) {
152 throw new IOException(
"Cannot write short value to byte array");
155 throw new IOException(
"Short array not allocated yet");
166 public void close() throws IOException {
void writeShort(int s)
Writes the specified short to this output.
void writeByte(int b)
Writes the specified byte to this output.
OutputArrayOrStream(byte[] byteValues)
OutputArrayOrStream(short[] shortValues)
void setOutputStream(OutputStream out, ByteOrder order)
void allocateShortArray(int length)
void allocateByteArray(int length)
void order(ByteOrder order)
OutputStream getOutputStream()
OutputArrayOrStream(OutputStream out, ByteOrder order)