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 de.bytefish.pgbulkinsert.pgsql.model.network.MacAddress;
006
007import java.io.DataOutputStream;
008
009public class MacAddressValueHandler extends BaseValueHandler<MacAddress> {
010
011    @Override
012    protected void internalHandle(DataOutputStream buffer, final MacAddress value) throws Exception {
013        buffer.writeInt(6);
014        buffer.write(value.getAddressBytes());
015    }
016
017    @Override
018    public int getLength(MacAddress value) {
019        return 6;
020    }
021}