: Class StringByteTools

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## FreeTest
Class StringByteTools

    java.lang.Object
      |
      +--FreeTest.StringByteTools

public class StringByteTools
extends java.lang.Object

Because all FREE communications (like HTTP) must be ASCII we can create some String <-> Byte conversion tools that bypass the massive performance hit of dealing with all Unicode characters. This class is based on code from "Java Performance and Scalbility. Volume 1" by Dov Bulka where figures indicate a factor of 6.8 perfomance improvement by using these methods.

Since:
  1.5
Version:
  0.1 7 February 2001
Author:
  Jason Kitcat

Constructor Summary
`StringByteTools()`

Method Summary
`static byte[]` | `asciiGetBytes(java.lang.String buf)` This method converts a String to bytes.
`static java.lang.String` | `asciiGetString(byte[] buf)` This method converts bytes to a String.

Methods inherited from class java.lang.Object
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### StringByteTools

    public StringByteTools()

Method Detail

### asciiGetBytes

    public static byte[] asciiGetBytes(java.lang.String buf)

  This method converts a String to bytes. Only if the String is pure ASCII
  Parameters:
    `buf` - String to be converted

### asciiGetString

    public static java.lang.String asciiGetString(byte[] buf)

  This method converts bytes to a String. Only if the byte array represents pure ASCII
  Parameters:
    `buf` - Bytes to be converted

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD