/*
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * 
 * $Id: ThrowingBinaryCoder.java 72629 2013-08-20 13:52:08Z supol $
 */

package com.sun.ts.tests.websocket.ee.javax.websocket.remoteendpoint.async;

import java.nio.ByteBuffer;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

public class ThrowingBinaryCoder implements Encoder.Binary<ByteBuffer> {
	public static final String ERROR = "TCK intended Exception on transmition";

	@Override
	public void init(EndpointConfig config) {
	}

	@Override
	public void destroy() {
	}

	@Override
	public ByteBuffer encode(ByteBuffer object) throws EncodeException {
		throw new EncodeException(object, ERROR);
	}

}
