comparison dwt/internal/image/JPEGVariableSizeSegment.d @ 34:5123b17c98ef

Ported dwt.events.*, dwt.graphics.GC, Region, dwt.internal.image.*
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sun, 14 Sep 2008 01:45:57 +0200
parents 1a8b3cb347e0
children
comparison
equal deleted inserted replaced
33:965ac0a77267 34:5123b17c98ef
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others. 2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de>
10 *******************************************************************************/ 12 *******************************************************************************/
11 module dwt.internal.image; 13 module dwt.internal.image.JPEGVariableSizeSegment;
12
13 14
14 import dwt.DWT; 15 import dwt.DWT;
16 import dwt.internal.image.JPEGSegment;
17 import dwt.internal.image.LEDataInputStream;
18
19 import tango.core.Exception;
15 20
16 abstract class JPEGVariableSizeSegment : JPEGSegment { 21 abstract class JPEGVariableSizeSegment : JPEGSegment {
17 22
18 public this(byte[] reference) { 23 public this(byte[] reference) {
19 super(reference); 24 super(reference);
20 } 25 }
21 26
22 public this(LEDataInputStream byteStream) { 27 public this(LEDataInputStream byteStream) {
23 try { 28 try {
24 byte[] header = new byte[4]; 29 byte[] header = new byte[4];
25 byteStream.read(header); 30 byteStream.read(header);
26 reference = header; // to use getSegmentLength() 31 reference = header; // to use getSegmentLength()