Top Description Inners Methods
com.oracle.bmc.http.client.pki

pack-priv Interface Utf8

extends CharSequence, Sensitive
Known Direct Implementers
com.oracle.bmc.http.client.pki.Utf8.Wrapper, com.oracle.bmc.http.client.pki.Utf8.Chars
Imports
java.io.ByteArrayOutputStream, .IOException, java.nio.ByteBuffer, .CharBuffer, .Buffer, java.nio.channels.Channels, .ReadableByteChannel, .WritableByteChannel, java.util.concurrent.CompletableFuture

Mutable byte buffer for UTF-8 encoded text. When the text has been consumed it MUST be erased via close() to avoid leaking sensitive data on the heap.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Utf8.Chars

Byte array backed Utf8

public static class

Method Summary

Modifier and TypeMethod and Description
public byte[]
public default boolean
contains(final String text)

public default int
public default int
indexOf(String text, int offset)

public static Utf8

Returns:

Utf8 instance
of
(byte[]
The bytes to wrap
bytes
)

Wrap a mutable byte array.

public static Utf8

Returns:

Utf8 buffer
of
(ReadableByteChannel
The content to buffer
content
)

Buffer the contents of a stream into a Utf8 buffer.

public static Utf8

Returns:

Utf8 instance
of
(final String
The string to wrap
text
)

Wrap an immutable String.

public Utf8

Returns:

Text with all whitespace removed
removeWhitespace
()

Strip all whitespace characters in the text

public Utf8
subSequence(int
the start index, inclusive
start
,
int
the end index, exclusive
end
)

Redeclares java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence.

public default Utf8
trim()

Inherited from com.oracle.bmc.http.client.pki.Sensitive:
close
Inherited from java.lang.CharSequence:
charAtcharscodePointscompareisEmptylengthtoString

Method Detail

bytesback to summary
public byte[] bytes()
containsback to summary
public default boolean contains(final String text)
indexOfback to summary
public default int indexOf(String text)
indexOfback to summary
public default int indexOf(String text, int offset)
ofback to summary
public static Utf8 of(byte[] bytes)

Wrap a mutable byte array. Does not claim ownership of the array. Caller is responsible for erasing the byte array

Parameters
bytes:byte[]

The bytes to wrap

Returns:Utf8

Utf8 instance

ofback to summary
public static Utf8 of(ReadableByteChannel content) throws IOException

Buffer the contents of a stream into a Utf8 buffer. The contents will be erased when the buffer is closed.

Parameters
content:ReadableByteChannel

The content to buffer

Returns:Utf8

Utf8 buffer

ofback to summary
public static Utf8 of(final String text)

Wrap an immutable String.

Parameters
text:String

The string to wrap

Returns:Utf8

Utf8 instance

removeWhitespaceback to summary
public Utf8 removeWhitespace()

Strip all whitespace characters in the text

Returns:Utf8

Text with all whitespace removed

subSequenceback to summary
public Utf8 subSequence(int start, int end)

Redeclares java.lang.CharSequence.subSequence.

Doc from java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Parameters
start:int

the start index, inclusive

end:int

the end index, exclusive

Returns:Utf8

the specified subsequence

Annotations
@Override
trimback to summary
public default Utf8 trim()
com.oracle.bmc.http.client.pki back to summary

public Class Utf8.Chars

extends Object
implements Utf8
Class Inheritance
All Implemented Interfaces
com.oracle.bmc.http.client.pki.Utf8, com.oracle.bmc.http.client.pki.Sensitive, java.lang.AutoCloseable, java.lang.CharSequence

Byte array backed Utf8

Field Summary

Modifier and TypeField and Description
private final transient CharBuffer

Constructor Summary

AccessConstructor and Description
private
Chars(final CharBuffer text)

Method Summary

Modifier and TypeMethod and Description
public byte[]
public char
charAt(int
the index of the char value to be returned
index
)

Implements java.lang.CharSequence.charAt.

Returns the char value at the specified index.

public void
close()

Implements com.oracle.bmc.http.client.pki.Sensitive.close.

Must erase the contents of the passphrase

private CharBuffer
copyOf(CharBuffer existing)

public int
length()

Implements java.lang.CharSequence.length.

Returns the length of this character sequence.

public Utf8
removeWhitespace()

Implements com.oracle.bmc.http.client.pki.Utf8.removeWhitespace.

Strip all whitespace characters in the text

public Utf8
subSequence(int
the start index, inclusive
beginIndex
,
int
the end index, exclusive
endIndex
)

Implements com.oracle.bmc.http.client.pki.Utf8.subSequence.

Returns a CharSequence that is a subsequence of this sequence.

public String
toString()

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString.

Returns a string containing the characters in this sequence in the same order as this sequence.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

textback to summary
private final transient CharBuffer text

Constructor Detail

Charsback to summary
private Chars(final CharBuffer text)

Method Detail

bytesback to summary
public byte[] bytes()

Implements com.oracle.bmc.http.client.pki.Utf8.bytes.

charAtback to summary
public char charAt(int index)

Implements java.lang.CharSequence.charAt.

Doc from java.lang.CharSequence.charAt.

Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Parameters
index:int

the index of the char value to be returned

Returns:char

the specified char value

Annotations
@Override
closeback to summary
public void close()

Implements com.oracle.bmc.http.client.pki.Sensitive.close.

Doc from com.oracle.bmc.http.client.pki.Sensitive.close.

Must erase the contents of the passphrase

Annotations
@Override
copyOfback to summary
private CharBuffer copyOf(CharBuffer existing)
lengthback to summary
public int length()

Implements java.lang.CharSequence.length.

Doc from java.lang.CharSequence.length.

Returns the length of this character sequence. The length is the number of 16-bit chars in the sequence.

Returns:int

the number of chars in this sequence

Annotations
@Override
removeWhitespaceback to summary
public Utf8 removeWhitespace()

Implements com.oracle.bmc.http.client.pki.Utf8.removeWhitespace.

Doc from com.oracle.bmc.http.client.pki.Utf8.removeWhitespace.

Strip all whitespace characters in the text

Returns:Utf8

Text with all whitespace removed

Annotations
@Override
subSequenceback to summary
public Utf8 subSequence(int beginIndex, int endIndex)

Implements com.oracle.bmc.http.client.pki.Utf8.subSequence.

Doc from java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Parameters
beginIndex:int

the start index, inclusive

endIndex:int

the end index, exclusive

Returns:Utf8

the specified subsequence

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString.

Doc from java.lang.CharSequence.toString.

Returns a string containing the characters in this sequence in the same order as this sequence. The length of the string will be the length of this sequence.

Returns:String

a string consisting of exactly this sequence of characters

Annotations
@Override
com.oracle.bmc.http.client.pki back to summary

public Class Utf8.Wrapper

extends Object
implements Utf8
Class Inheritance
All Implemented Interfaces
com.oracle.bmc.http.client.pki.Utf8, com.oracle.bmc.http.client.pki.Sensitive, java.lang.AutoCloseable, java.lang.CharSequence

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
private
Wrapper(final String target)

Method Summary

Modifier and TypeMethod and Description
public byte[]
public char
charAt(int
the index of the char value to be returned
index
)

Implements java.lang.CharSequence.charAt.

Returns the char value at the specified index.

public void
close()

Implements com.oracle.bmc.http.client.pki.Sensitive.close.

Must erase the contents of the passphrase

public int
indexOf(String text, int offset)

Overrides default com.oracle.bmc.http.client.pki.Utf8.indexOf.

public int
length()

Implements java.lang.CharSequence.length.

Returns the length of this character sequence.

public Utf8
removeWhitespace()

Implements com.oracle.bmc.http.client.pki.Utf8.removeWhitespace.

Strip all whitespace characters in the text

public Utf8
subSequence(int
the start index, inclusive
start
,
int
the end index, exclusive
end
)

Implements com.oracle.bmc.http.client.pki.Utf8.subSequence.

Returns a CharSequence that is a subsequence of this sequence.

public Utf8
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

targetback to summary
private final String target

Constructor Detail

Wrapperback to summary
private Wrapper(final String target)

Method Detail

bytesback to summary
public byte[] bytes()

Implements com.oracle.bmc.http.client.pki.Utf8.bytes.

Annotations
@Override
charAtback to summary
public char charAt(int index)

Implements java.lang.CharSequence.charAt.

Doc from java.lang.CharSequence.charAt.

Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Parameters
index:int

the index of the char value to be returned

Returns:char

the specified char value

Annotations
@Override
closeback to summary
public void close()

Implements com.oracle.bmc.http.client.pki.Sensitive.close.

Doc from com.oracle.bmc.http.client.pki.Sensitive.close.

Must erase the contents of the passphrase

Annotations
@Override
indexOfback to summary
public int indexOf(String text, int offset)

Overrides default com.oracle.bmc.http.client.pki.Utf8.indexOf.

Annotations
@Override
lengthback to summary
public int length()

Implements java.lang.CharSequence.length.

Doc from java.lang.CharSequence.length.

Returns the length of this character sequence. The length is the number of 16-bit chars in the sequence.

Returns:int

the number of chars in this sequence

Annotations
@Override
removeWhitespaceback to summary
public Utf8 removeWhitespace()

Implements com.oracle.bmc.http.client.pki.Utf8.removeWhitespace.

Doc from com.oracle.bmc.http.client.pki.Utf8.removeWhitespace.

Strip all whitespace characters in the text

Returns:Utf8

Text with all whitespace removed

Annotations
@Override
subSequenceback to summary
public Utf8 subSequence(int start, int end)

Implements com.oracle.bmc.http.client.pki.Utf8.subSequence.

Doc from java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Parameters
start:int

the start index, inclusive

end:int

the end index, exclusive

Returns:Utf8

the specified subsequence

Annotations
@Override
trimback to summary
public Utf8 trim()

Overrides default com.oracle.bmc.http.client.pki.Utf8.trim.

Annotations
@Override