Java Object Deserialize deserialize(byte[] features)

Here you can find the source of deserialize(byte[] features)

Description

Deserialize byte array to object List

License

Open Source License

Parameter

Parameter Description
features a parameter

Exception

Parameter Description
IOException an exception
ClassNotFoundException an exception

Declaration

public static List<Double> deserialize(byte[] features) throws IOException, ClassNotFoundException 

Method Source Code

//package com.java2s;
/**// w  w w. j a va 2s. c o m
 * This file is part of Flipper Open Reverse Image Search.
    
 Flipper Open Reverse Image Search is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
    
 Flipper Open Reverse Image Search is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
    
 You should have received a copy of the GNU General Public License
 along with Flipper Open Reverse Image Search.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.io.*;

import java.util.List;

public class Main {
    /**
     * Deserialize byte array to object List
     * @param features
     * @return
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public static List<Double> deserialize(byte[] features) throws IOException, ClassNotFoundException {
        ByteArrayInputStream bis = new ByteArrayInputStream(features);
        ObjectInput in = new ObjectInputStream(bis);

        List<Double> result = (List<Double>) in.readObject();

        in.close();

        return result;

    }
}

Related

  1. deserialize(byte[] data)
  2. deserialize(byte[] data)
  3. deserialize(byte[] data)
  4. deserialize(byte[] data)
  5. deserialize(byte[] data)
  6. deserialize(byte[] in)
  7. deserialize(byte[] in)
  8. Deserialize(byte[] objectBytes)
  9. deserialize(byte[] objectData)