/** Store a String and return the stored address. */
 public final long store(final String s) {
   final int strlen = s.length();
   if (strlen < CHUNKED_THRESHOLD) {
     s.getChars(0, strlen, tmpBuf, 0);
     return storeCharChunk(tmpBuf, 0, strlen);
   }
   final byte[] b = StringUtils.getBytes(s);
   return storeStringChunk(b);
 }
Exemple #2
0
 public ByteArray(@CheckForNull String data) {
   if (data == null) {
     throw new IllegalArgumentException();
   }
   this.bytea = StringUtils.getBytes(data);
 }