package com.hughes.android.dictionary.engine;
-import com.hughes.util.IndexedObject;
-import com.hughes.util.raf.RAFListSerializer;
-
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.io.Serializable;
-public class EntrySource extends IndexedObject implements Serializable {
+import com.hughes.util.IndexedObject;
+import com.hughes.util.raf.RAFListSerializer;
- private static final long serialVersionUID = -1323165134846120269L;
+public class EntrySource extends IndexedObject {
final String name;
+ @SuppressWarnings("CanBeFinal")
int numEntries;
+ @SuppressWarnings("WeakerAccess")
public EntrySource(final int index, final String name, int numEntries) {
super(index);
this.name = name;
}
@Override
- public EntrySource read(RandomAccessFile raf, int readIndex)
- throws IOException {
+ public EntrySource read(DataInput raf, int readIndex)
+ throws IOException {
final String name = raf.readUTF();
final int numEntries = dictionary.dictFileVersion >= 3 ? raf.readInt() : 0;
return new EntrySource(readIndex, name, numEntries);
}
@Override
- public void write(RandomAccessFile raf, EntrySource t) throws IOException {
+ public void write(DataOutput raf, EntrySource t) throws IOException {
raf.writeUTF(t.name);
raf.writeInt(t.numEntries);
}