Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8adc0154 authored by Yuichiro Hanada's avatar Yuichiro Hanada
Browse files

Remove populateOptions(final ByteBuffer buffer).

Change-Id: Ifc4c64c9cffe4f343c5a604c192db010a1792acc
parent 65e49700
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.HashMap;
@@ -358,14 +357,15 @@ class BinaryDictionaryGetter {
        try {
            // Read the version of the file
            inStream = new FileInputStream(f);
            final ByteBuffer buffer = inStream.getChannel().map(
                    FileChannel.MapMode.READ_ONLY, 0, f.length());
            final int magic = buffer.getInt();
            final BinaryDictInputOutput.ByteBufferWrapper buffer =
                    new BinaryDictInputOutput.ByteBufferWrapper(inStream.getChannel().map(
                            FileChannel.MapMode.READ_ONLY, 0, f.length()));
            final int magic = buffer.readInt();
            if (magic != FormatSpec.VERSION_2_MAGIC_NUMBER) {
                return false;
            }
            final int formatVersion = buffer.getInt();
            final int headerSize = buffer.getInt();
            final int formatVersion = buffer.readInt();
            final int headerSize = buffer.readInt();
            final HashMap<String, String> options = CollectionUtils.newHashMap();
            BinaryDictInputOutput.populateOptions(buffer, headerSize, options);

+0 −5
Original line number Diff line number Diff line
@@ -1543,11 +1543,6 @@ public class BinaryDictInputOutput {
            options.put(key, value);
        }
    }
    // TODO: remove this method.
    public static void populateOptions(final ByteBuffer buffer, final int headerSize,
            final HashMap<String, String> options) {
        populateOptions(new ByteBufferWrapper(buffer), headerSize, options);
    }

    /**
     * Reads a buffer and returns the memory representation of the dictionary.