APIdia Launch Partner
Top Fields Constructors Methods
jdk.internal.jimage

public Class ImageStringsReader

extends Object
implements ImageStrings
Class Inheritance
All Implemented Interfaces
jdk.internal.jimage.ImageStrings
Imports
java.io.UTFDataFormatException, java.nio.ByteBuffer, java.nio.charset.StandardCharsets, java.util.Objects

Implementation Note

This class needs to maintain JDK 8 source compatibility. It is used internally in the JDK to implement jimage/jrtfs access, but also compiled and delivered as part of the jrtfs.jar to support access to the jimage file provided by the shipped JDK by tools running on JDK 8.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
private final BasicImageReader

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
private static void
charsFromByteBuffer(char[] chars, ByteBuffer buffer, int offset)

private static int
charsFromByteBufferLength(ByteBuffer buffer, int offset)

Calculates the number of characters in the String present at the specified offset.

pack-priv static void
charsFromMUTF8(char[] chars, byte[] bytes, int offset, int count)

pack-priv static int
charsFromMUTF8Length(byte[] bytes, int offset, int count)

public String
public static int
public static int
hashCode(String s, int seed)

public static int
hashCode(String module, String name)

public static int
hashCode(String module, String name, int seed)

public int
match(int offset, String string, int stringOffset)

Overrides default jdk.internal.jimage.ImageStrings.match.

If there's a string at offset matching in full a substring of string starting at stringOffset, return the length of that string.

pack-priv static void
mutf8FromString(byte[] bytes, int offset, String s)

public static byte[]
pack-priv static int
public static String
pack-priv static String
stringFromByteBuffer(ByteBuffer buffer, int offset)

pack-priv static int
stringFromByteBufferMatches(ByteBuffer buffer, int offset, String string, int stringOffset)

public static String
stringFromMUTF8(byte[] bytes, int offset, int count)

public static String
stringFromMUTF8(byte[] bytes)

public static int
unmaskedHashCode(String s, int seed)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

HASH_MULTIPLIERback to summary
public static final int HASH_MULTIPLIER
POSITIVE_MASKback to summary
public static final int POSITIVE_MASK
readerback to summary
private final BasicImageReader reader

Constructor Detail

ImageStringsReaderback to summary
pack-priv ImageStringsReader(BasicImageReader reader)

Method Detail

addback to summary
public int add(final String string)

Implements jdk.internal.jimage.ImageStrings.add.

Annotations
@Override
charsFromByteBufferback to summary
private static void charsFromByteBuffer(char[] chars, ByteBuffer buffer, int offset)
charsFromByteBufferLengthback to summary
private static int charsFromByteBufferLength(ByteBuffer buffer, int offset)

Calculates the number of characters in the String present at the specified offset. As an optimization, the length returned will be positive if the characters are all ASCII, and negative otherwise.

charsFromMUTF8back to summary
pack-priv static void charsFromMUTF8(char[] chars, byte[] bytes, int offset, int count) throws UTFDataFormatException
charsFromMUTF8Lengthback to summary
pack-priv static int charsFromMUTF8Length(byte[] bytes, int offset, int count)
getback to summary
public String get(int offset)

Implements jdk.internal.jimage.ImageStrings.get.

Annotations
@Override
hashCodeback to summary
public static int hashCode(String s)
hashCodeback to summary
public static int hashCode(String s, int seed)
hashCodeback to summary
public static int hashCode(String module, String name)
hashCodeback to summary
public static int hashCode(String module, String name, int seed)
matchback to summary
public int match(int offset, String string, int stringOffset)

Overrides default jdk.internal.jimage.ImageStrings.match.

Doc from jdk.internal.jimage.ImageStrings.match.

If there's a string at offset matching in full a substring of string starting at stringOffset, return the length of that string. Otherwise returns -1. Optional operation.

Annotations
@Override
mutf8FromStringback to summary
pack-priv static void mutf8FromString(byte[] bytes, int offset, String s)
mutf8FromStringback to summary
public static byte[] mutf8FromString(String string)
mutf8FromStringLengthback to summary
pack-priv static int mutf8FromStringLength(String s)
stringFromByteBufferback to summary
public static String stringFromByteBuffer(ByteBuffer buffer)
stringFromByteBufferback to summary
pack-priv static String stringFromByteBuffer(ByteBuffer buffer, int offset)
stringFromByteBufferMatchesback to summary
pack-priv static int stringFromByteBufferMatches(ByteBuffer buffer, int offset, String string, int stringOffset)
stringFromMUTF8back to summary
public static String stringFromMUTF8(byte[] bytes, int offset, int count)
stringFromMUTF8back to summary
public static String stringFromMUTF8(byte[] bytes)
unmaskedHashCodeback to summary
public static int unmaskedHashCode(String s, int seed)