gnu.javax.imageio.bmp

Class BMPFileHeader


public class BMPFileHeader
extends Object

Field Summary

static int
SIZE
BITMAPFILEHEADER is 14 bytes
protected long
bfOffBits
Offset from the beginning of the file to the bitmap data
protected long
bfSize
Bitmap file size, in bytes.

Constructor Summary

BMPFileHeader(ImageInputStream in)
Creates the header from an input stream, which is not closed.
BMPFileHeader(ImageOutputStream out, IIOImage im)
Creates the header from an output stream, which is not closed.

Method Summary

long
getOffset()
Gets the bitmap offset within the file
long
getSize()
Gets the file size
void
setOffset(long offset)
Sets the bitmap offset within the file
void
setSize(long size)
Sets the file size
void
write(ImageOutputStream out)
Writes the header to an output stream, which is not closed or flushed.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

SIZE

public static final int SIZE
BITMAPFILEHEADER is 14 bytes
Field Value:
14

bfOffBits

protected long bfOffBits
Offset from the beginning of the file to the bitmap data

bfSize

protected long bfSize
Bitmap file size, in bytes.

Constructor Details

BMPFileHeader

public BMPFileHeader(ImageInputStream in)
            throws IOException,
                   BMPException
Creates the header from an input stream, which is not closed.
Throws:
IOException - if an I/O error occured.
BMPException - if the header was invalid

BMPFileHeader

public BMPFileHeader(ImageOutputStream out,
                     IIOImage im)
            throws IOException
Creates the header from an output stream, which is not closed.
Parameters:
out - - the image output stream
im - - the image
Throws:
IOException - if an I/O error occured.

Method Details

getOffset

public long getOffset()
Gets the bitmap offset within the file

getSize

public long getSize()
Gets the file size

setOffset

public void setOffset(long offset)
Sets the bitmap offset within the file

setSize

public void setSize(long size)
Sets the file size

write

public void write(ImageOutputStream out)
            throws IOException
Writes the header to an output stream, which is not closed or flushed.
Throws:
IOException - if an I/O error occured.

BMPFileHeader.java -- Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.