Struct rust_jvm::vm::constant_pool::ModifiedUtf8String
[−]
[src]
pub struct ModifiedUtf8String { bytes: Vec<u8>, }
Represents a modified UTF-8 string (§4.4.7). This structure is created directly from the bytes in the class file, and has not undergone any kind of validation.
Fields
bytes |
Methods
impl ModifiedUtf8String
fn new(bytes: Vec<u8>) -> Self
fn to_string(&self) -> String
Converts a modified UTF-8 string to a Rust String
.
fn to_utf16(&self) -> Vec<u16>
Converts a modified UTF-8 string to a UTF-16 string. This function is provided as an
optimization in creating Java String
literals, which are in UTF-16 format. It does not
validate surrogate pairs.