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.handlers.utils.GeometricUtils;
006import de.bytefish.pgbulkinsert.pgsql.model.geometric.Point;
007
008import java.io.DataOutputStream;
009
010public class PointValueHandler extends BaseValueHandler<Point> {
011
012    @Override
013    protected void internalHandle(DataOutputStream buffer, final Point value) throws Exception {
014        buffer.writeInt(16);
015
016        GeometricUtils.writePoint(buffer, value);
017    }
018
019    @Override
020    public int getLength(Point value) {
021        return 16;
022    }
023}