aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/afp/modca/ImageSegment.java
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2007-12-12 12:24:10 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2007-12-12 12:24:10 +0000
commite30bf175fe7a4caddd9379b44599b31dada3895a (patch)
tree82e26cf01a492a1db3dd2dcc708ae07c1fc3d2a4 /src/java/org/apache/fop/render/afp/modca/ImageSegment.java
parent3ad1cf6d677d963b63f89a01114a4f8de176bd2b (diff)
downloadxmlgraphics-fop-e30bf175fe7a4caddd9379b44599b31dada3895a.tar.gz
xmlgraphics-fop-e30bf175fe7a4caddd9379b44599b31dada3895a.zip
* Added an SVG handler and Graphics2D implementation for AFP which injects AFP GOCA structured fields into the AFPDataStream.
* Fixed many checkstyle problems. * Updated xmlgraphics-commons-1.3svn.jar to include changes to TextHandler git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@603590 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/afp/modca/ImageSegment.java')
-rw-r--r--src/java/org/apache/fop/render/afp/modca/ImageSegment.java17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/java/org/apache/fop/render/afp/modca/ImageSegment.java b/src/java/org/apache/fop/render/afp/modca/ImageSegment.java
index 7d6cc18aa..5f8454fa8 100644
--- a/src/java/org/apache/fop/render/afp/modca/ImageSegment.java
+++ b/src/java/org/apache/fop/render/afp/modca/ImageSegment.java
@@ -18,6 +18,7 @@
/* $Id$ */
package org.apache.fop.render.afp.modca;
+
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
@@ -67,15 +68,12 @@ public class ImageSegment extends AbstractAFPObject {
* @param name The name of the image.
*/
public ImageSegment(String name) {
-
if (name.length() != 4) {
String msg = "Image segment name must be 4 characters long " + name;
log.error("Constructor:: " + msg);
throw new IllegalArgumentException(msg);
}
-
this.name = name;
-
try {
this.nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING);
} catch (UnsupportedEncodingException usee) {
@@ -162,24 +160,18 @@ public class ImageSegment extends AbstractAFPObject {
* @throws java.io.IOException if an I/O exception occurred
*/
public void writeDataStream(OutputStream os) throws IOException {
-
writeStart(os);
-
if (imageContent != null) {
imageContent.writeDataStream(os);
}
-
writeEnd(os);
-
}
/**
* Helper method to write the start of the Image Segment.
* @param os The stream to write to
*/
- private void writeStart(OutputStream os)
- throws IOException {
-
+ private void writeStart(OutputStream os) throws IOException {
byte[] data = new byte[] {
0x70, // ID
0x04, // Length
@@ -188,13 +180,9 @@ public class ImageSegment extends AbstractAFPObject {
0x00, // Name byte 3
0x00, // Name byte 4
};
-
for (int i = 0; i < nameBytes.length; i++) {
-
data[2 + i] = nameBytes[i];
-
}
-
os.write(data);
}
@@ -204,7 +192,6 @@ public class ImageSegment extends AbstractAFPObject {
* @param os The stream to write to
*/
private void writeEnd(OutputStream os) throws IOException {
-
byte[] data = new byte[] {
0x71, // ID
0x00, // Length