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 ByteValueHandler<T extends Number> extends BaseValueHandler<T> { 008 009 @Override 010 protected void internalHandle(DataOutputStream buffer, final T value) throws Exception { 011 buffer.writeInt(1); 012 buffer.writeByte(value.byteValue()); 013 } 014 015 @Override 016 public int getLength(T value) { 017 return 1; 018 } 019}