Пример #1
0
 /**
  * Set the encoding. If the object was constructed from bytes[]. any previous conversion is reset.
  * If no encoding is set, we'll use 8859-1.
  */
 public void setEncoding(String enc) {
   if (!byteC.isNull()) {
     // if the encoding changes we need to reset the converion results
     charC.recycle();
     hasStrValue = false;
   }
   byteC.setEncoding(enc);
 }
Пример #2
0
 /**
  * Set the encoding. If the object was constructed from bytes[]. any previous conversion is reset.
  * If no encoding is set, we'll use 8859-1.
  */
 public void setCharset(Charset charset) {
   if (!byteC.isNull()) {
     // if the encoding changes we need to reset the conversion results
     charC.recycle();
     hasStrValue = false;
   }
   byteC.setCharset(charset);
 }
Пример #3
0
 /** Unimplemented yet. Do a char->byte conversion. */
 public void toBytes() {
   if (!byteC.isNull()) {
     type = T_BYTES;
     return;
   }
   toString();
   type = T_BYTES;
   byte bb[] = strValue.getBytes();
   byteC.setBytes(bb, 0, bb.length);
 }
Пример #4
0
 public boolean isNull() {
   //		should we check also hasStrValue ???
   return byteC.isNull() && charC.isNull() && !hasStrValue;
   // bytes==null && strValue==null;
 }