📄 iobuffer.java
字号:
/** * @see java.nio.Buffer#flip() */ public abstract IoBuffer flip(); /** * @see java.nio.Buffer#rewind() */ public abstract IoBuffer rewind(); /** * @see java.nio.Buffer#remaining() */ public abstract int remaining(); /** * @see java.nio.Buffer#hasRemaining() */ public abstract boolean hasRemaining(); /** * @see ByteBuffer#duplicate() */ public abstract IoBuffer duplicate(); /** * @see ByteBuffer#slice() */ public abstract IoBuffer slice(); /** * @see ByteBuffer#asReadOnlyBuffer() */ public abstract IoBuffer asReadOnlyBuffer(); /** * @see ByteBuffer#hasArray() */ public abstract boolean hasArray(); /** * @see ByteBuffer#array() */ public abstract byte[] array(); /** * @see ByteBuffer#arrayOffset() */ public abstract int arrayOffset(); /** * @see ByteBuffer#get() */ public abstract byte get(); /** * Reads one unsigned byte as a short integer. */ public abstract short getUnsigned(); /** * @see ByteBuffer#put(byte) */ public abstract IoBuffer put(byte b); /** * @see ByteBuffer#get(int) */ public abstract byte get(int index); /** * Reads one byte as an unsigned short integer. */ public abstract short getUnsigned(int index); /** * @see ByteBuffer#put(int, byte) */ public abstract IoBuffer put(int index, byte b); /** * @see ByteBuffer#get(byte[], int, int) */ public abstract IoBuffer get(byte[] dst, int offset, int length); /** * @see ByteBuffer#get(byte[]) */ public abstract IoBuffer get(byte[] dst); /** * TODO document me. */ public abstract IoBuffer getSlice(int index, int length); /** * TODO document me. */ public abstract IoBuffer getSlice(int length); /** * Writes the content of the specified <tt>src</tt> into this buffer. */ public abstract IoBuffer put(ByteBuffer src); /** * Writes the content of the specified <tt>src</tt> into this buffer. */ public abstract IoBuffer put(IoBuffer src); /** * @see ByteBuffer#put(byte[], int, int) */ public abstract IoBuffer put(byte[] src, int offset, int length); /** * @see ByteBuffer#put(byte[]) */ public abstract IoBuffer put(byte[] src); /** * @see ByteBuffer#compact() */ public abstract IoBuffer compact(); /** * @see ByteBuffer#order() */ public abstract ByteOrder order(); /** * @see ByteBuffer#order(ByteOrder) */ public abstract IoBuffer order(ByteOrder bo); /** * @see ByteBuffer#getChar() */ public abstract char getChar(); /** * @see ByteBuffer#putChar(char) */ public abstract IoBuffer putChar(char value); /** * @see ByteBuffer#getChar(int) */ public abstract char getChar(int index); /** * @see ByteBuffer#putChar(int, char) */ public abstract IoBuffer putChar(int index, char value); /** * @see ByteBuffer#asCharBuffer() */ public abstract CharBuffer asCharBuffer(); /** * @see ByteBuffer#getShort() */ public abstract short getShort(); /** * Reads two bytes unsigned integer. */ public abstract int getUnsignedShort(); /** * @see ByteBuffer#putShort(short) */ public abstract IoBuffer putShort(short value); /** * @see ByteBuffer#getShort() */ public abstract short getShort(int index); /** * Reads two bytes unsigned integer. */ public abstract int getUnsignedShort(int index); /** * @see ByteBuffer#putShort(int, short) */ public abstract IoBuffer putShort(int index, short value); /** * @see ByteBuffer#asShortBuffer() */ public abstract ShortBuffer asShortBuffer(); /** * @see ByteBuffer#getInt() */ public abstract int getInt(); /** * Reads four bytes unsigned integer. */ public abstract long getUnsignedInt(); /** * Relative <i>get</i> method for reading a medium int value. * * <p> Reads the next three bytes at this buffer's current position, * composing them into an int value according to the current byte order, * and then increments the position by three.</p> * * @return The medium int value at the buffer's current position */ public abstract int getMediumInt(); /** * Relative <i>get</i> method for reading an unsigned medium int value. * * <p> Reads the next three bytes at this buffer's current position, * composing them into an int value according to the current byte order, * and then increments the position by three.</p> * * @return The unsigned medium int value at the buffer's current position */ public abstract int getUnsignedMediumInt(); /** * Absolute <i>get</i> method for reading a medium int value. * * <p> Reads the next three bytes at this buffer's current position, * composing them into an int value according to the current byte order.</p> * * @param index The index from which the medium int will be read * @return The medium int value at the given index * * @throws IndexOutOfBoundsException * If <tt>index</tt> is negative * or not smaller than the buffer's limit */ public abstract int getMediumInt(int index); /** * Absolute <i>get</i> method for reading an unsigned medium int value. * * <p> Reads the next three bytes at this buffer's current position, * composing them into an int value according to the current byte order.</p> * * @param index The index from which the unsigned medium int will be read * @return The unsigned medium int value at the given index * * @throws IndexOutOfBoundsException * If <tt>index</tt> is negative * or not smaller than the buffer's limit */ public abstract int getUnsignedMediumInt(int index); /** * Relative <i>put</i> method for writing a medium int * value. * * <p> Writes three bytes containing the given int value, in the * current byte order, into this buffer at the current position, and then * increments the position by three.</p> * * @param value * The medium int value to be written * * @return This buffer * * @throws BufferOverflowException * If there are fewer than three bytes * remaining in this buffer * * @throws ReadOnlyBufferException * If this buffer is read-only */ public abstract IoBuffer putMediumInt(int value); /** * Absolute <i>put</i> method for writing a medium int * value. * * <p> Writes three bytes containing the given int value, in the * current byte order, into this buffer at the given index.</p> * * @param index * The index at which the bytes will be written * * @param value * The medium int value to be written * * @return This buffer * * @throws IndexOutOfBoundsException * If <tt>index</tt> is negative * or not smaller than the buffer's limit, * minus three * * @throws ReadOnlyBufferException * If this buffer is read-only */ public abstract IoBuffer putMediumInt(int index, int value); /** * @see ByteBuffer#putInt(int) */ public abstract IoBuffer putInt(int value); /** * @see ByteBuffer#getInt(int) */ public abstract int getInt(int index); /** * Reads four bytes unsigned integer. */ public abstract long getUnsignedInt(int index); /** * @see ByteBuffer#putInt(int, int) */ public abstract IoBuffer putInt(int index, int value); /** * @see ByteBuffer#asIntBuffer() */ public abstract IntBuffer asIntBuffer(); /** * @see ByteBuffer#getLong() */ public abstract long getLong(); /** * @see ByteBuffer#putLong(int, long) */ public abstract IoBuffer putLong(long value); /** * @see ByteBuffer#getLong(int) */ public abstract long getLong(int index); /** * @see ByteBuffer#putLong(int, long) */ public abstract IoBuffer putLong(int index, long value); /** * @see ByteBuffer#asLongBuffer() */ public abstract LongBuffer asLongBuffer(); /** * @see ByteBuffer#getFloat() */ public abstract float getFloat(); /** * @see ByteBuffer#putFloat(float) */ public abstract IoBuffer putFloat(float value); /** * @see ByteBuffer#getFloat(int) */ public abstract float getFloat(int index); /** * @see ByteBuffer#putFloat(int, float) */ public abstract IoBuffer putFloat(int index, float value); /** * @see ByteBuffer#asFloatBuffer() */ public abstract FloatBuffer asFloatBuffer(); /** * @see ByteBuffer#getDouble() */ public abstract double getDouble(); /** * @see ByteBuffer#putDouble(double) */ public abstract IoBuffer putDouble(double value); /** * @see ByteBuffer#getDouble(int) */ public abstract double getDouble(int index); /** * @see ByteBuffer#putDouble(int, double) */ public abstract IoBuffer putDouble(int index, double value); /** * @see ByteBuffer#asDoubleBuffer() */ public abstract DoubleBuffer asDoubleBuffer(); /** * Returns an {@link InputStream} that reads the data from this buffer. * {@link InputStream#read()} returns <tt>-1</tt> if the buffer position * reaches to the limit. */ public abstract InputStream asInputStream(); /** * Returns an {@link OutputStream} that appends the data into this buffer. * Please note that the {@link OutputStream#write(int)} will throw a * {@link BufferOverflowException} instead of an {@link IOException} * in case of buffer overflow. Please set <tt>autoExpand</tt> property by * calling {@link #setAutoExpand(boolean)} to prevent the unexpected runtime * exception. */ public abstract OutputStream asOutputStream(); /** * Returns hexdump of this buffer. The data and pointer are * not changed as a result of this method call. * * @return * hexidecimal representation of this buffer */ public abstract String getHexDump(); /** * Return hexdump of this buffer with limited length. * * @param lengthLimit The maximum number of bytes to dump from * the current buffer position. * @return * hexidecimal representation of this buffer */ public abstract String getHexDump(int lengthLimit); //////////////////////////////// // String getters and putters // //////////////////////////////// /** * Reads a <code>NUL</code>-terminated string from this buffer using the * specified <code>decoder</code> and returns it. This method reads * until the limit of this buffer if no <tt>NUL</tt> is found. */ public abstract String getString(CharsetDecoder decoder) throws CharacterCodingException; /** * Reads a <code>NUL</code>-terminated string from this buffer using the * specified <code>decoder</code> and returns it. * * @param fieldSize the maximum number of bytes to read */ public abstract String getString(int fieldSize, CharsetDecoder decoder) throws CharacterCodingException; /**
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -