001// Licensed under the MIT license. See LICENSE file in the project root for full license information.
002
003package de.bytefish.pgbulkinsert.pgsql.handlers;
004
005import java.io.DataOutputStream;
006
007public class ByteArrayValueHandler extends BaseValueHandler<byte[]> {
008
009        @Override
010        protected void internalHandle(DataOutputStream buffer, final byte[] value) throws Exception {
011                buffer.writeInt(value.length);
012                buffer.write(value, 0, value.length);
013        }
014
015        @Override
016        public int getLength(byte[] value) {
017                return value.length;
018        }
019}