Top Description Inners Fields Constructors Methods
org.jboss.jandex

pack-priv Class Utils

extends Object
Class Inheritance
Imports
java.io.BufferedInputStream, .DataInputStream, .InputStream, java.nio.charset.StandardCharsets, java.util.ArrayList, .Collection, .Collections, .List, .Map, .Objects

Common utilities
Author
Jason T. Greene

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
private static class

Field Summary

Modifier and TypeField and Description
pack-priv static final byte[]
pack-priv static final byte[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static <T> List<T>
emptyOrWrap(List<T> list)

pack-priv static <T> Collection<T>
pack-priv static <K, V> Map<K, V>
emptyOrWrap(Map<K, V> map)

pack-priv static String
fromUTF8(byte[] bytes)

pack-priv static <T> List<T>
listOfCapacity(int capacity)

pack-priv static byte[]
toUTF8(String string)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CLINIT_METHOD_NAMEback to summary
pack-priv static final byte[] CLINIT_METHOD_NAME
INIT_METHOD_NAMEback to summary
pack-priv static final byte[] INIT_METHOD_NAME

Constructor Detail

Utilsback to summary
pack-priv Utils()

Method Detail

emptyOrWrapback to summary
pack-priv static <T> List<T> emptyOrWrap(List<T> list)
emptyOrWrapback to summary
pack-priv static <T> Collection<T> emptyOrWrap(Collection<T> list)
emptyOrWrapback to summary
pack-priv static <K, V> Map<K, V> emptyOrWrap(Map<K, V> map)
fromUTF8back to summary
pack-priv static String fromUTF8(byte[] bytes)
listOfCapacityback to summary
pack-priv static <T> List<T> listOfCapacity(int capacity)
toUTF8back to summary
pack-priv static byte[] toUTF8(String string)
org.jboss.jandex back to summary

pack-priv final Class Utils.ReusableBufferedDataInputStream

extends DataInputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Utils.ReusableBufferedInputStream

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterInputStream.close.

Implements java.io.Closeable.close.

Closes this input stream and releases any system resources associated with the stream.
public synchronized void
mark(int
the maximum limit of bytes that can be read before the mark position becomes invalid.
readlimit
)

Overrides java.io.FilterInputStream.mark.

Deprecated
Marks the current position in this input stream.
public boolean
markSupported()

Overrides java.io.FilterInputStream.markSupported.

Tests if this input stream supports the mark and reset methods.
public synchronized void
reset()

Overrides java.io.FilterInputStream.reset.

Deprecated
Repositions this stream to the position at the time the mark method was last called on this input stream.
pack-priv void
Inherited from java.io.DataInputStream:
readreadreadBooleanreadBytereadCharreadDoublereadFloatreadFullyreadFullyreadIntreadLinereadLongreadShortreadUnsignedBytereadUnsignedShortreadUTFreadUTFskipBytes

Field Detail

reusableBufferedback to summary
private Utils.ReusableBufferedInputStream reusableBuffered

Constructor Detail

ReusableBufferedDataInputStreamback to summary
pack-priv ReusableBufferedDataInputStream()

Method Detail

closeback to summary
public void close()

Overrides java.io.FilterInputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.FilterInputStream.close.

Closes this input stream and releases any system resources associated with the stream.

Annotations
@Override
markback to summary
public synchronized void mark(int readlimit)

Overrides java.io.FilterInputStream.mark.

Doc from java.io.FilterInputStream.mark.

Deprecated

Marks the current position in this input stream. A subsequent call to the reset method repositions this stream at the last marked position so that subsequent reads re-read the same bytes.

The readlimit argument tells this input stream to allow that many bytes to be read before the mark position gets invalidated.

Parameters
readlimit:int

the maximum limit of bytes that can be read before the mark position becomes invalid.

Annotations
@Override
@Deprecated
markSupportedback to summary
public boolean markSupported()

Overrides java.io.FilterInputStream.markSupported.

Doc from java.io.FilterInputStream.markSupported.

Tests if this input stream supports the mark and reset methods.

Returns:boolean

true if this stream type supports the mark and reset method; false otherwise.

Annotations
@Override
resetback to summary
public synchronized void reset()

Overrides java.io.FilterInputStream.reset.

Doc from java.io.FilterInputStream.reset.

Deprecated

Repositions this stream to the position at the time the mark method was last called on this input stream.

Stream marks are intended to be used in situations where you need to read ahead a little to see what's in the stream. Often this is most easily done by invoking some general parser. If the stream is of the type handled by the parse, it just chugs along happily. If the stream is not of that type, the parser should toss an exception when it fails. If this happens within readlimit bytes, it allows the outer code to reset the stream and try another parser.

Annotations
@Override
@Deprecated
setInputStreamback to summary
pack-priv void setInputStream(InputStream in)
org.jboss.jandex back to summary

private final Class Utils.ReusableBufferedInputStream

extends BufferedInputStream
Class Inheritance

Field Summary

Inherited from java.io.BufferedInputStream:
bufcountmarklimitmarkpospos

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.BufferedInputStream.close.

Implements java.io.Closeable.close.

Closes this input stream and releases any system resources associated with the stream.
public synchronized void
mark(int
the maximum limit of bytes that can be read before the mark position becomes invalid.
readlimit
)

Overrides java.io.BufferedInputStream.mark.

Deprecated
See the general contract of the mark method of InputStream.
public boolean
markSupported()

Overrides java.io.BufferedInputStream.markSupported.

Tests if this input stream supports the mark and reset methods.
public synchronized void
reset()

Overrides java.io.BufferedInputStream.reset.

Deprecated
See the general contract of the reset method of InputStream.
pack-priv void
Inherited from java.io.BufferedInputStream:
availablereadreadskiptransferTo

Constructor Detail

ReusableBufferedInputStreamback to summary
private ReusableBufferedInputStream()

Method Detail

closeback to summary
public void close()

Overrides java.io.BufferedInputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.BufferedInputStream.close.

Closes this input stream and releases any system resources associated with the stream. Once the stream has been closed, further read(), available(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.

Annotations
@Override
markback to summary
public synchronized void mark(int readlimit)

Overrides java.io.BufferedInputStream.mark.

Doc from java.io.BufferedInputStream.mark.

Deprecated

See the general contract of the mark method of InputStream.

Parameters
readlimit:int

the maximum limit of bytes that can be read before the mark position becomes invalid.

Annotations
@Override
@Deprecated
markSupportedback to summary
public boolean markSupported()

Overrides java.io.BufferedInputStream.markSupported.

Doc from java.io.BufferedInputStream.markSupported.

Tests if this input stream supports the mark and reset methods. The markSupported method of BufferedInputStream returns true.

Returns:boolean

a boolean indicating if this stream type supports the mark and reset methods.

Annotations
@Override
resetback to summary
public synchronized void reset()

Overrides java.io.BufferedInputStream.reset.

Doc from java.io.BufferedInputStream.reset.

Deprecated

See the general contract of the reset method of InputStream.

If markpos is -1 (no mark has been set or the mark has been invalidated), an IOException is thrown. Otherwise, pos is set equal to markpos.

Annotations
@Override
@Deprecated
setInputStreamback to summary
pack-priv void setInputStream(InputStream in)