Skip to content

Commit 1fc859b

Browse files
committed
Implement Serializable for a few new classes
1 parent 9eb0f1d commit 1fc859b

File tree

13 files changed

+47
-10
lines changed

13 files changed

+47
-10
lines changed

io/src/main/java/com/itextpdf/io/font/FontEncoding.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
import com.itextpdf.io.util.IntHashtable;
44
import com.itextpdf.io.util.Utilities;
55

6+
import java.io.Serializable;
67
import java.util.StringTokenizer;
78

8-
public class FontEncoding {
9+
public class FontEncoding implements Serializable {
10+
11+
private static final long serialVersionUID = -684967385759439083L;
912

1013
private static final byte[] emptyBytes = new byte[0];
1114

io/src/main/java/com/itextpdf/io/font/FontIdentification.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package com.itextpdf.io.font;
22

3-
public class FontIdentification {
3+
import java.io.Serializable;
4+
5+
public class FontIdentification implements Serializable {
6+
7+
private static final long serialVersionUID = -6017656004487895604L;
48

59
// name ID 5
610
private String ttfVersion;

io/src/main/java/com/itextpdf/io/font/FontMetrics.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package com.itextpdf.io.font;
22

3-
public class FontMetrics {
3+
import java.io.Serializable;
4+
5+
public class FontMetrics implements Serializable {
6+
7+
private static final long serialVersionUID = -7113134666493365588L;
48

59
protected float normalizationCoef = 1f;
610

io/src/main/java/com/itextpdf/io/font/FontNames.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.itextpdf.io.font;
22

3+
import java.io.Serializable;
34
import java.util.List;
45
import java.util.Map;
56

6-
public class FontNames {
7+
public class FontNames implements Serializable {
8+
9+
private static final long serialVersionUID = 1005168842463622025L;
710

811
//macStyle bits
912
// Bit 0: Bold (if set to 1);

io/src/main/java/com/itextpdf/io/font/FontProgram.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
import com.itextpdf.io.font.otf.Glyph;
55

66
import java.io.File;
7+
import java.io.Serializable;
78
import java.util.HashMap;
89
import java.util.Map;
910

10-
public abstract class FontProgram {
11+
public abstract class FontProgram implements Serializable {
12+
13+
private static final long serialVersionUID = -3488910249070253659L;
1114

1215
public static final int DEFAULT_WIDTH = 1000;
1316
public static final int UNITS_NORMALIZATION = 1000;

io/src/main/java/com/itextpdf/io/font/Type1Font.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
public class Type1Font extends FontProgram {
1616

17+
private static final long serialVersionUID = -1078208220942939920L;
18+
1719
private Type1Parser fontParser;
1820

1921
private String characterSet;

io/src/main/java/com/itextpdf/io/font/Type1Parser.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
import java.io.ByteArrayOutputStream;
99
import java.io.EOFException;
1010
import java.io.InputStream;
11+
import java.io.Serializable;
1112

12-
class Type1Parser {
13+
class Type1Parser implements Serializable {
14+
15+
private static final long serialVersionUID = -8484541242371901414L;
1316

1417
private static final String AfmHeader = "StartFontMetrics";
1518

io/src/main/java/com/itextpdf/io/font/otf/Glyph.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@
4646

4747
import com.itextpdf.io.util.Utilities;
4848

49+
import java.io.Serializable;
4950
import java.util.Arrays;
5051

51-
public class Glyph {
52+
public class Glyph implements Serializable {
53+
54+
private static final long serialVersionUID = 1627806639423114471L;
5255

5356
// The <i>code</i> or <i>id</i> by which this is represented in the Font File.
5457
private final int code;

io/src/main/java/com/itextpdf/io/source/RandomAccessSourceFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
import java.io.FileInputStream;
77
import java.io.InputStream;
88
import java.io.RandomAccessFile;
9+
import java.io.Serializable;
910
import java.net.URL;
1011
import java.nio.channels.FileChannel;
1112
import java.text.MessageFormat;
1213

1314
/**
1415
* Factory to create {@link RandomAccessSource} objects based on various types of sources
1516
*/
16-
public final class RandomAccessSourceFactory {
17+
public final class RandomAccessSourceFactory implements Serializable {
18+
19+
private static final long serialVersionUID = -8958482579413233761L;
1720

1821
/**
1922
* Whether the full content of the source should be read into memory at construction

io/src/main/java/com/itextpdf/io/util/IntHashtable.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.itextpdf.io.util;
22

3+
import java.io.Serializable;
34
import java.util.Arrays;
45
import java.util.Iterator;
56
import java.util.NoSuchElementException;
@@ -17,7 +18,9 @@
1718
* @author Bruno Lowagie (change Objects as keys into int values)
1819
* @author Paulo Soares (added extra methods)
1920
*/
20-
public class IntHashtable implements Cloneable {
21+
public class IntHashtable implements Cloneable, Serializable {
22+
23+
private static final long serialVersionUID = 7354463962269093965L;
2124

2225
/***
2326
* The hash table data.

0 commit comments

Comments
 (0)