01: /*******************************************************************************
02: * Copyright (c) 2000, 2003 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.swt.internal.image;
11:
12: import org.eclipse.swt.*;
13:
14: abstract class JPEGFixedSizeSegment extends JPEGSegment {
15:
16: public JPEGFixedSizeSegment() {
17: reference = new byte[fixedSize()];
18: setSegmentMarker(signature());
19: }
20:
21: public JPEGFixedSizeSegment(byte[] reference) {
22: super (reference);
23: }
24:
25: public JPEGFixedSizeSegment(LEDataInputStream byteStream) {
26: reference = new byte[fixedSize()];
27: try {
28: byteStream.read(reference);
29: } catch (Exception e) {
30: SWT.error(SWT.ERROR_IO, e);
31: }
32: }
33:
34: abstract public int fixedSize();
35:
36: public int getSegmentLength() {
37: return fixedSize() - 2;
38: }
39:
40: public void setSegmentLength(int length) {
41: }
42: }
|