package com.palacesun.engine.logging.format;

public class PostgreSQLBinaryFormat implements BinaryFormat {
   private static final int PREFIX_LENGTH = 2;
   private static final int QUOTE_COUNT = 2;

   public String toString(byte[] input) {
      char[] result = new char[4 + input.length * 2];
      int i = 0;
      result[i++] = '\'';
      result[i++] = '\\';
      result[i++] = 'x';
      HexEncodedBinaryFormat.hexEncode(input, result, i);
      result[result.length - 1] = '\'';
      return new String(result);
   }
}
