### php.java.bridge

# Class Options

- `java.lang.Object`

- `php.java.bridge.Options`

`public class Options`
`extends java.lang.Object`

Exposes the request options. There is one Options instance for each request, but certain options may change for each packet. For example if a user calls java_set_file_encoding(enc), the new file encoding becomes available in the next packet.

Author:
  jostb

## Method Summary

`boolean`

`extJavaCompatibility()`
  Returns true if bit 0 of the request header is set (see PROTOCOL.TXT).

`byte[]`

`getBytes(java.lang.String s)`
  Return a byte array using the current file encoding (see java_set_file_encoding()).

`java.lang.String`

`getEncoding()`
  Returns the file encoding, see java_set_file_encoding().

`java.lang.String`

`newString(byte[] b)`
  Return a new string using the current file encoding (see java_set_file_encoding()).

`java.lang.String`

`newString(byte[] b, int start, int length)`
  Return a new string using the current file encoding (see java_set_file_encoding()).

`boolean`

`sendArraysAsValues()`
  Returns true if bit 1 of the request header is set (see PROTOCOL.TXT).

### Methods inherited from class java.lang.Object

`equals`, `getClass`, `hashCode`, `notify`, `notifyAll`, `toString`, `wait`, `wait`, `wait`

## Method Details

### extJavaCompatibility

    public boolean extJavaCompatibility()

> Returns true if bit 0 of the request header is set (see PROTOCOL.TXT). This options stays the same for all packets.

> Returns:
>   the value of the request header bit 0

### getBytes

    public byte[] getBytes(java.lang.String s)

> Return a byte array using the current file encoding (see java_set_file_encoding()).

> Parameters:
>   `s` - The string

> Returns:
>   The encoded bytes.

### getEncoding

    public java.lang.String getEncoding()

> Returns the file encoding, see java_set_file_encoding(). This option may change for each packet.

> Returns:
>   The file encoding

### newString

    public java.lang.String newString(byte[] b)

> Return a new string using the current file encoding (see java_set_file_encoding()).

> Parameters:
>   `b` - The byte array

> Returns:
>   The encoded string.

### newString

    public java.lang.String newString(byte[] b,
                                      int start,
                                      int length)

> Return a new string using the current file encoding (see java_set_file_encoding()).

> Parameters:
>   `b` - The byte array
>   `start` - The start index
>   `length` - The number of bytes to encode.

> Returns:
>   The encoded string.

### sendArraysAsValues

    public boolean sendArraysAsValues()

> Returns true if bit 1 of the request header is set (see PROTOCOL.TXT). This option stays the same for all packets.

> Returns:
>   the value of the request header bit 1.