public final class WritableFontData extends ReadableFontData
FontData.DataSize
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(java.io.InputStream is)
Copy everything from the InputStream into this FontData.
|
void |
copyFrom(java.io.InputStream is,
int length)
Copy from the InputStream into this FontData.
|
static WritableFontData |
createWritableFontData(byte[] b)
Constructs a writable font data object.
|
static WritableFontData |
createWritableFontData(int length)
Constructs a writable font data object.
|
static WritableFontData |
createWritableFontData(ReadableFontData original)
Constructs a writable font data object.
|
WritableFontData |
slice(int offset)
Makes a bottom bound only slice of this array.
|
WritableFontData |
slice(int offset,
int length)
Makes a slice of this FontData.
|
int |
writeByte(int index,
byte b)
Writes a byte at the given index.
|
int |
writeBytes(int index,
byte[] b)
Writes the bytes from the array.
|
int |
writeBytes(int index,
byte[] b,
int offset,
int length)
Writes the bytes from the array.
|
int |
writeBytesPad(int index,
byte[] b,
int offset,
int length,
byte pad)
Writes the bytes from the array and pad if necessary.
|
int |
writeChar(int index,
byte c)
Writes the CHAR at the given index.
|
int |
writeDateTime(int index,
long date)
Writes the LONGDATETIME at the given index.
|
int |
writeFixed(int index,
int f)
Writes the Fixed at the given index.
|
int |
writeLong(int index,
long l)
Writes the LONG at the given index.
|
int |
writePadding(int index,
int count)
Writes padding to the FontData.
|
int |
writePadding(int index,
int count,
byte pad)
Writes padding to the FontData.
|
int |
writeShort(int index,
int s)
Writes the SHORT at the given index.
|
int |
writeUInt24(int index,
int ui)
Writes the UINT24 at the given index.
|
int |
writeULong(int index,
long ul)
Writes the ULONG at the given index.
|
int |
writeULongLE(int index,
long ul)
Writes the ULONG at the given index in little endian format.
|
int |
writeUShort(int index,
int us)
Writes the USHORT at the given index.
|
int |
writeUShortLE(int index,
int us)
Writes the USHORT at the given index in little endian format.
|
checksum, checkSumRange, copyTo, copyTo, createReadableFontData, readByte, readBytes, readChar, readDateTimeAsLong, readF2Dot14, readFixed, readFUnit, readFWord, readLong, readLongDateTime, readShort, readUByte, readUFWord, readUInt24, readULong, readULongAsInt, readULongLE, readUShort, searchULong, searchUShort, searchUShort, setCheckSumRanges, toString, toString
public static final WritableFontData createWritableFontData(int length)
length
- if length > 0 create a fixed length font data; otherwise
create a growable font datapublic static final WritableFontData createWritableFontData(byte[] b)
b
- the byte array to wrappublic static final WritableFontData createWritableFontData(ReadableFontData original)
original
- the source font datapublic WritableFontData slice(int offset, int length)
FontData
.slice
in class ReadableFontData
offset
- the start of the slicelength
- the number of bytes in the slicepublic WritableFontData slice(int offset)
FontData
.slice
in class ReadableFontData
offset
- the start of the slicepublic int writeByte(int index, byte b)
index
- index into the font datab
- the byte to writepublic int writeBytes(int index, byte[] b, int offset, int length)
index
- index into the font datab
- the source for the bytes to be writtenoffset
- offset in the byte arraylength
- the length of the bytes to be writtenpublic int writeBytesPad(int index, byte[] b, int offset, int length, byte pad)
index
- index into the font datab
- the source for the bytes to be writtenoffset
- offset in the byte arraylength
- the length of the bytes to be writtenpad
- the padding byte to be used if necessarypublic int writePadding(int index, int count)
index
- index into the font datacount
- the number of pad bytes to writepublic int writePadding(int index, int count, byte pad)
index
- index into the font datacount
- the number of pad bytes to writepad
- the byte value to use as paddingpublic int writeBytes(int index, byte[] b)
index
- index into the font datab
- the source for the bytes to be writtenpublic int writeChar(int index, byte c)
index
- index into the font datac
- the CHARjava.lang.IndexOutOfBoundsException
- if index is outside the FontData's rangepublic int writeUShort(int index, int us)
index
- index into the font dataus
- the USHORTjava.lang.IndexOutOfBoundsException
- if index is outside the FontData's rangepublic int writeUShortLE(int index, int us)
index
- index into the font dataus
- the USHORTjava.lang.IndexOutOfBoundsException
- if index is outside the FontData's rangepublic int writeShort(int index, int s)
index
- index into the font datas
- the SHORTjava.lang.IndexOutOfBoundsException
- if index is outside the FontData's rangepublic int writeUInt24(int index, int ui)
index
- index into the font dataui
- the UINT24java.lang.IndexOutOfBoundsException
- if index is outside the FontData's rangepublic int writeULong(int index, long ul)
index
- index into the font dataul
- the ULONGjava.lang.IndexOutOfBoundsException
- if index is outside the FontData's rangepublic int writeULongLE(int index, long ul)
index
- index into the font dataul
- the ULONGjava.lang.IndexOutOfBoundsException
- if index is outside the FontData's rangepublic int writeLong(int index, long l)
index
- index into the font datal
- the LONGjava.lang.IndexOutOfBoundsException
- if index is outside the FontData's rangepublic int writeFixed(int index, int f)
index
- index into the font dataf
- the Fixedjava.lang.IndexOutOfBoundsException
- if index is outside the FontData's rangepublic int writeDateTime(int index, long date)
index
- index into the font datadate
- the LONGDATETIMEjava.lang.IndexOutOfBoundsException
- if index is outside the FontData's rangepublic void copyFrom(java.io.InputStream is, int length) throws java.io.IOException
is
- the sourcelength
- the number of bytes to copyjava.io.IOException
public void copyFrom(java.io.InputStream is) throws java.io.IOException
is
- the sourcejava.io.IOException