All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nmote.iim4j.serialize.BinarySerializer Maven / Gradle / Ivy

Go to download

IIM4J allows Java programmers to read, write and process IPTC IIM version 4 files.

The newest version!
/*
 * Copyright (c) Nmote Ltd. 2004-2015. All rights reserved. 
 * See LICENSE doc in a root of project folder for additional information.
 */

package com.nmote.iim4j.serialize;

/**
 * Binary data Serializer.
 */
public class BinarySerializer implements Serializer {

	public BinarySerializer() {
		this(null);
	}

	public BinarySerializer(String def) {
		maxLength = def != null ? Integer.parseInt(def) : Integer.MAX_VALUE;
	}

	public Object deserialize(byte[] data, SerializationContext ctx) throws SerializationException {
		return data;
	}

	public byte[] serialize(Object o, SerializationContext ctx) throws SerializationException {
		return (byte[]) o;
	}

	@SuppressWarnings("unused")
	private final int maxLength;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy