Converts this string to a byte array using the default encoding as specified by the file.encoding system property. If the system property is not defined, the default encoding is ISO8859_1 (ISO-Latin-1). If 8859-1 is not available, an ASCII encoding is used. @return the byte array encoding of this s
()
| 821 | * @return the byte array encoding of this string. |
| 822 | */ |
| 823 | public byte[] getBytes() { |
| 824 | ByteBuffer buffer = defaultCharset().encode( |
| 825 | CharBuffer.wrap(this.value, this.offset, this.count)); |
| 826 | byte[] bytes = new byte[buffer.limit()]; |
| 827 | buffer.get(bytes); |
| 828 | return bytes; |
| 829 | } |
| 830 | |
| 831 | /** |
| 832 | * Converts this string to a byte array, ignoring the high order bits of |
no test coverage detected