public abstract class AbstractAFPObject extends java.lang.Object implements Streamable
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractAFPObject.Category
structured field category codes
|
static interface |
AbstractAFPObject.Type
structured field type codes
|
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
LOG
Static logging instance
|
protected static byte |
SF_CLASS
the structured field class id
|
protected static int |
SF_HEADER_LENGTH
Length of bytes of a Structured Field Header
|
| Constructor and Description |
|---|
AbstractAFPObject() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
copySF(byte[] data,
byte type,
byte category)
Copies the template structured field data array to the given byte array
|
protected static void |
copySF(byte[] data,
byte clazz,
byte type,
byte category)
Copies the template structured field data array to the given byte array
|
protected static java.lang.String |
truncate(java.lang.String str,
int maxLength)
Truncates the string as necessary
|
protected static void |
writeChunksToStream(byte[] data,
byte[] dataHeader,
int lengthOffset,
int maxChunkLength,
java.io.OutputStream os)
Writes data chunks to a given outputstream
|
protected <S extends Streamable> |
writeObjects(java.util.Collection<S> objects,
java.io.OutputStream os)
Writes a collection of Streamable to the AFP Datastream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwriteToStreamprotected static final org.apache.commons.logging.Log LOG
protected static final byte SF_CLASS
protected static final int SF_HEADER_LENGTH
protected void copySF(byte[] data,
byte type,
byte category)
data - the structured field data byte arraytype - the type codecategory - the category codeprotected static void copySF(byte[] data,
byte clazz,
byte type,
byte category)
data - the structured field data byte arrayclazz - the class codetype - the type codecategory - the category codeprotected <S extends Streamable> void writeObjects(java.util.Collection<S> objects, java.io.OutputStream os) throws java.io.IOException
S - Streamable view of an AFPObjectobjects - a list of AFPObjectsos - The stream to write tojava.io.IOException - an I/O exception of some sort has occurred.protected static void writeChunksToStream(byte[] data,
byte[] dataHeader,
int lengthOffset,
int maxChunkLength,
java.io.OutputStream os)
throws java.io.IOException
data - the data byte arraydataHeader - the header datalengthOffset - offset of length field in data chunkmaxChunkLength - the maximum chunk lengthos - the outputstream to write tojava.io.IOException - thrown if an I/O exception of some sort has occurred.protected static java.lang.String truncate(java.lang.String str,
int maxLength)
str - a character stringmaxLength - the maximum length allowed for the stringCopyright 1999-2022 The Apache Software Foundation. All Rights Reserved.