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.Circle; 007 008import java.io.DataOutputStream; 009 010public class CircleValueHandler extends BaseValueHandler<Circle> { 011 012 @Override 013 protected void internalHandle(DataOutputStream buffer, final Circle value) throws Exception { 014 buffer.writeInt(24); 015 // First encode the Center Point: 016 GeometricUtils.writePoint(buffer, value.getCenter()); 017 // ... and then the Radius: 018 buffer.writeDouble(value.getRadius()); 019 } 020 021 @Override 022 public int getLength(Circle value) { 023 return 24; 024 } 025}