Netty 学习之旅:ByteBuf 篇之 ByteBuf 内部结构与 API 学习

/**

  • Gets a 32-bit floating point number at the current {@code readerIndex}

  • and increases the {@code readerIndex} by {@code 4} in this buffer.

  • @throws IndexOutOfBoundsException

  •     if {@code this.readableBytes} is less than {@code 4}
    

*/

public abstract float readFloat();

/**

  • Gets a 64-bit floating point number at the current {@code readerIndex}

  • and increases the {@code readerIndex} by {@code 8} in this buffer.

  • @throws IndexOutOfBoundsException

  •     if {@code this.readableBytes} is less than {@code 8}
    

*/

public abstract double readDouble();

/**

  • Transfers this buffer’s data to a newly created buffer starting at

  • the current {@code readerIndex} and increases the {@code readerIndex}

  • by the number of the transferred bytes (= {@code length}).

  • The returned buffer’s {@code readerIndex} and {@code writerIndex} are

  • {@code 0} and {@code length} respectively.

  • @param length the number of bytes to transfer

  • @return the newly created buffer which contains the transferred bytes

  • @throws IndexOutOfBoundsException

  •     if {@code length} is greater than {@code this.readableBytes}
    

*/

public abstract ByteBuf readBytes(int length);

/**

  • Returns a new slice of this buffer’s sub-region starting at the current

  • {@code readerIndex} and increases the {@code readerIndex} by the size

  • of the new slice (= {@code length}).

  • @param length the size of the new slice

  • @return the newly created slice

  • @throws IndexOutOfBoundsException

  •     if {@code length} is greater than {@code this.readableBytes}
    

*/

public abstract ByteBuf readSlice(int length);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the current {@code readerIndex} until the destination becomes

  • non-writable, and increases the {@code readerIndex} by the number of the

  • transferred bytes. This method is basically same with

  • {@link #readBytes(ByteBuf, int, int)}, except that this method

  • increases the {@code writerIndex} of the destination by the number of

  • the transferred bytes while {@link #readBytes(ByteBuf, int, int)}

  • does not.

  • @throws IndexOutOfBoundsException

  •     if {@code dst.writableBytes} is greater than
    
  •        {@code this.readableBytes}
    

*/

public abstract ByteBuf readBytes(ByteBuf dst);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the current {@code readerIndex} and increases the {@code readerIndex}

  • by the number of the transferred bytes (= {@code length}). This method

  • is basically same with {@link #readBytes(ByteBuf, int, int)},

  • except that this method increases the {@code writerIndex} of the

  • destination by the number of the transferred bytes (= {@code length})

  • while {@link #readBytes(ByteBuf, int, int)} does not.

  • @throws IndexOutOfBoundsException

  •     if {@code length} is greater than {@code this.readableBytes} or
    
  •     if {@code length} is greater than {@code dst.writableBytes}
    

*/

public abstract ByteBuf readBytes(ByteBuf dst, int length);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the current {@code readerIndex} and increases the {@code readerIndex}

  • by the number of the transferred bytes (= {@code length}).

  • @param dstIndex the first index of the destination

  • @param length the number of bytes to transfer

  • @throws IndexOutOfBoundsException

  •     if the specified {@code dstIndex} is less than {@code 0},
    
  •     if {@code length} is greater than {@code this.readableBytes}, or
    
  •     if {@code dstIndex + length} is greater than
    
  •        {@code dst.capacity}
    

*/

public abstract ByteBuf readBytes(ByteBuf dst, int dstIndex, int length);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the current {@code readerIndex} and increases the {@code readerIndex}

  • by the number of the transferred bytes (= {@code dst.length}).

  • @throws IndexOutOfBoundsException

  •     if {@code dst.length} is greater than {@code this.readableBytes}
    

*/

public abstract ByteBuf readBytes(byte[] dst);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the current {@code readerIndex} and increases the {@code readerIndex}

  • by the number of the transferred bytes (= {@code length}).

  • @param dstIndex the first index of the destination

  • @param length the number of bytes to transfer

  • @throws IndexOutOfBoundsException

  •     if the specified {@code dstIndex} is less than {@code 0},
    
  •     if {@code length} is greater than {@code this.readableBytes}, or
    
  •     if {@code dstIndex + length} is greater than {@code dst.length}
    

*/

public abstract ByteBuf readBytes(byte[] dst, int dstIndex, int length);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the current {@code readerIndex} until the destination’s position

  • reaches its limit, and increases the {@code readerIndex} by the

  • number of the transferred bytes.

  • @throws IndexOutOfBoundsException

  •     if {@code dst.remaining()} is greater than
    
  •        {@code this.readableBytes}
    

*/

public abstract ByteBuf readBytes(ByteBuffer dst);

/**

  • Transfers this buffer’s data to the specified stream starting at the

  • current {@code readerIndex}.

  • @param length the number of bytes to transfer

  • @throws IndexOutOfBoundsException

  •     if {@code length} is greater than {@code this.readableBytes}
    
  • @throws IOException

  •     if the specified stream threw an exception during I/O
    

*/

public abstract ByteBuf readBytes(OutputStream out, int length) throws IOException;

/**

  • Transfers this buffer’s data to the specified stream starting at the

  • current {@code readerIndex}.

  • @param length the maximum number of bytes to transfer

  • @return the actual number of bytes written out to the specified channel

  • @throws IndexOutOfBoundsException

  •     if {@code length} is greater than {@code this.readableBytes}
    
  • @throws IOException

  •     if the specified channel threw an exception during I/O
    

*/

public abstract int readBytes(GatheringByteChannel out, int length) throws IOException;

对于上面的方法,我挑如下三个进行重点说明一下,其他的类似:

  • public abstract ByteBuf readBytes(byte[] dst)

从 ByteBuf 缓存区中读取 dst.length 个字节到 dst 目标数组中,返回当前的 ByteBuf, 这是级联设计风格,如果 ByteBuf 可剩余可读字节小于 dst.length,则抛出异常。

  • public abstract ByteBuf readBytes(int length)

从 ByteBuf 缓存区读取 length 个字节到新创建的 ByteBuf, 注意返回的 ByteBuf 是先创建的,这不是级联设计风格。

  • public abstract ByteBuf readBytes(ByteBuf dst)

从 ByteBuf 缓存区读取 ds t可写字节长度到 dst 中,返回的 ByteBuf 是级联风格设计,如果 dst 的可剩余写长度大于操作的缓存区时,将抛出异常。

  • public abstract ByteBuf readSlice(int length)

从 ButeBuf 缓存区读取 length 个字节到 ByteBuf 中,这里的 ByteBuf 是原 ByteBuf 的视图,独立的 readIndex, writerIndex。

2.2.2 顺序写API

/**

  • Sets the specified boolean at the current {@code writerIndex}

  • and increases the {@code writerIndex} by {@code 1} in this buffer.

  • @throws IndexOutOfBoundsException

  •     if {@code this.writableBytes} is less than {@code 1}
    

*/

public abstract ByteBuf writeBoolean(boolean value);

/**

  • Sets the specified byte at the current {@code writerIndex}

  • and increases the {@code writerIndex} by {@code 1} in this buffer.

  • The 24 high-order bits of the specified value are ignored.

  • @throws IndexOutOfBoundsException

  •     if {@code this.writableBytes} is less than {@code 1}
    

*/

public abstract ByteBuf writeByte(int value);

/**

  • Sets the specified 16-bit short integer at the current

  • {@code writerIndex} and increases the {@code writerIndex} by {@code 2}

  • in this buffer. The 16 high-order bits of the specified value are ignored.

  • @throws IndexOutOfBoundsException

  •     if {@code this.writableBytes} is less than {@code 2}
    

*/

public abstract ByteBuf writeShort(int value);

/**

  • Sets the specified 24-bit medium integer at the current

  • {@code writerIndex} and increases the {@code writerIndex} by {@code 3}

  • in this buffer.

  • @throws IndexOutOfBoundsException

  •     if {@code this.writableBytes} is less than {@code 3}
    

*/

public abstract ByteBuf writeMedium(int value);

/**

  • Sets the specified 32-bit integer at the current {@code writerIndex}

  • and increases the {@code writerIndex} by {@code 4} in this buffer.

  • @throws IndexOutOfBoundsException

  •     if {@code this.writableBytes} is less than {@code 4}
    

*/

public abstract ByteBuf writeInt(int value);

/**

  • Sets the specified 64-bit long integer at the current

  • {@code writerIndex} and increases the {@code writerIndex} by {@code 8}

  • in this buffer.

  • @throws IndexOutOfBoundsException

  •     if {@code this.writableBytes} is less than {@code 8}
    

*/

public abstract ByteBuf writeLong(long value);

/**

  • Sets the specified 2-byte UTF-16 character at the current

  • {@code writerIndex} and increases the {@code writerIndex} by {@code 2}

  • in this buffer. The 16 high-order bits of the specified value are ignored.

  • @throws IndexOutOfBoundsException

  •     if {@code this.writableBytes} is less than {@code 2}
    

*/

public abstract ByteBuf writeChar(int value);

/**

  • Sets the specified 32-bit floating point number at the current

  • {@code writerIndex} and increases the {@code writerIndex} by {@code 4}

  • in this buffer.

  • @throws IndexOutOfBoundsException

  •     if {@code this.writableBytes} is less than {@code 4}
    

*/

public abstract ByteBuf writeFloat(float value);

/**

  • Sets the specified 64-bit floating point number at the current

  • {@code writerIndex} and increases the {@code writerIndex} by {@code 8}

  • in this buffer.

  • @throws IndexOutOfBoundsException

  •     if {@code this.writableBytes} is less than {@code 8}
    

*/

public abstract ByteBuf writeDouble(double value);

/**

  • Transfers the specified source buffer’s data to this buffer starting at

  • the current {@code writerIndex} until the source buffer becomes

  • unreadable, and increases the {@code writerIndex} by the number of

  • the transferred bytes. This method is basically same with

  • {@link #writeBytes(ByteBuf, int, int)}, except that this method

  • increases the {@code readerIndex} of the source buffer by the number of

  • the transferred bytes while {@link #writeBytes(ByteBuf, int, int)}

  • does not.

  • @throws IndexOutOfBoundsException

  •     if {@code src.readableBytes} is greater than
    
  •        {@code this.writableBytes}
    

*/

public abstract ByteBuf writeBytes(ByteBuf src);

/**

  • Transfers the specified source buffer’s data to this buffer starting at

  • the current {@code writerIndex} and increases the {@code writerIndex}

  • by the number of the transferred bytes (= {@code length}). This method

  • is basically same with {@link #writeBytes(ByteBuf, int, int)},

  • except that this method increases the {@code readerIndex} of the source

  • buffer by the number of the transferred bytes (= {@code length}) while

  • {@link #writeBytes(ByteBuf, int, int)} does not.

  • @param length the number of bytes to transfer

  • @throws IndexOutOfBoundsException

  •     if {@code length} is greater than {@code this.writableBytes} or
    
  •     if {@code length} is greater then {@code src.readableBytes}
    

*/

public abstract ByteBuf writeBytes(ByteBuf src, int length);

/**

  • Transfers the specified source buffer’s data to this buffer starting at

  • the current {@code writerIndex} and increases the {@code writerIndex}

  • by the number of the transferred bytes (= {@code length}).

  • @param srcIndex the first index of the source

  • @param length the number of bytes to transfer

  • @throws IndexOutOfBoundsException

  •     if the specified {@code srcIndex} is less than {@code 0},
    
  •     if {@code srcIndex + length} is greater than
    
  •        {@code src.capacity}, or
    
  •     if {@code length} is greater than {@code this.writableBytes}
    

*/

public abstract ByteBuf writeBytes(ByteBuf src, int srcIndex, int length);

/**

  • Transfers the specified source array’s data to this buffer starting at

  • the current {@code writerIndex} and increases the {@code writerIndex}

  • by the number of the transferred bytes (= {@code src.length}).

  • @throws IndexOutOfBoundsException

  •     if {@code src.length} is greater than {@code this.writableBytes}
    

*/

public abstract ByteBuf writeBytes(byte[] src);

/**

  • Transfers the specified source array’s data to this buffer starting at

  • the current {@code writerIndex} and increases the {@code writerIndex}

  • by the number of the transferred bytes (= {@code length}).

  • @param srcIndex the first index of the source

  • @param length the number of bytes to transfer

  • @throws IndexOutOfBoundsException

  •     if the specified {@code srcIndex} is less than {@code 0},
    
  •     if {@code srcIndex + length} is greater than
    
  •        {@code src.length}, or
    
  •     if {@code length} is greater than {@code this.writableBytes}
    

*/

public abstract ByteBuf writeBytes(byte[] src, int srcIndex, int length);

/**

  • Transfers the specified source buffer’s data to this buffer starting at

  • the current {@code writerIndex} until the source buffer’s position

  • reaches its limit, and increases the {@code writerIndex} by the

  • number of the transferred bytes.

  • @throws IndexOutOfBoundsException

  •     if {@code src.remaining()} is greater than
    
  •        {@code this.writableBytes}
    

*/

public abstract ByteBuf writeBytes(ByteBuffer src);

/**

  • Transfers the content of the specified stream to this buffer

  • starting at the current {@code writerIndex} and increases the

  • {@code writerIndex} by the number of the transferred bytes.

  • @param length the number of bytes to transfer

  • @return the actual number of bytes read in from the specified stream

  • @throws IndexOutOfBoundsException

  •     if {@code length} is greater than {@code this.writableBytes}
    
  • @throws IOException

  •     if the specified stream threw an exception during I/O
    

*/

public abstract int writeBytes(InputStream in, int length) throws IOException;

/**

  • Transfers the content of the specified channel to this buffer

  • starting at the current {@code writerIndex} and increases the

  • {@code writerIndex} by the number of the transferred bytes.

  • @param length the maximum number of bytes to transfer

  • @return the actual number of bytes read in from the specified channel

  • @throws IndexOutOfBoundsException

  •     if {@code length} is greater than {@code this.writableBytes}
    
  • @throws IOException

  •     if the specified channel threw an exception during I/O
    

*/

public abstract int writeBytes(ScatteringByteChannel in, int length) throws IOException;

/**

  • Fills this buffer with NUL (0x00) starting at the current

  • {@code writerIndex} and increases the {@code writerIndex} by the

  • specified {@code length}.

  • @param length the number of NULs to write to the buffer

  • @throws IndexOutOfBoundsException

  •     if {@code length} is greater than {@code this.writableBytes}
    

*/

public abstract ByteBuf writeZero(int length);

重点强调一下如下方法,其他的类似。

  • public abstract ByteBuf writeBytes(byte[] src)

将字节数组 src 全部写入到缓存区中,如果 src.length 大于 ByteBuf 可写区域的话,会抛出异常。

2.2.3 随机读API

/**

  • Gets a boolean at the specified absolute (@code index) in this buffer.

  • This method does not modify the {@code readerIndex} or {@code writerIndex}

  • of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 1} is greater than {@code this.capacity}
    

*/

public abstract boolean getBoolean(int index);

/**

  • Gets a byte at the specified absolute {@code index} in this buffer.

  • This method does not modify {@code readerIndex} or {@code writerIndex} of

  • this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 1} is greater than {@code this.capacity}
    

*/

public abstract byte getByte(int index);

/**

  • Gets an unsigned byte at the specified absolute {@code index} in this

  • buffer. This method does not modify {@code readerIndex} or

  • {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 1} is greater than {@code this.capacity}
    

*/

public abstract short getUnsignedByte(int index);

/**

  • Gets a 16-bit short integer at the specified absolute {@code index} in

  • this buffer. This method does not modify {@code readerIndex} or

  • {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 2} is greater than {@code this.capacity}
    

*/

public abstract short getShort(int index);

/**

  • Gets an unsigned 16-bit short integer at the specified absolute

  • {@code index} in this buffer. This method does not modify

  • {@code readerIndex} or {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 2} is greater than {@code this.capacity}
    

*/

public abstract int getUnsignedShort(int index);

/**

  • Gets a 24-bit medium integer at the specified absolute {@code index} in

  • this buffer. This method does not modify {@code readerIndex} or

  • {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 3} is greater than {@code this.capacity}
    

*/

public abstract int getMedium(int index);

/**

  • Gets an unsigned 24-bit medium integer at the specified absolute

  • {@code index} in this buffer. This method does not modify

  • {@code readerIndex} or {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 3} is greater than {@code this.capacity}
    

*/

public abstract int getUnsignedMedium(int index);

/**

  • Gets a 32-bit integer at the specified absolute {@code index} in

  • this buffer. This method does not modify {@code readerIndex} or

  • {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 4} is greater than {@code this.capacity}
    

*/

public abstract int getInt(int index);

/**

  • Gets an unsigned 32-bit integer at the specified absolute {@code index}

  • in this buffer. This method does not modify {@code readerIndex} or

  • {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 4} is greater than {@code this.capacity}
    

*/

public abstract long getUnsignedInt(int index);

/**

  • Gets a 64-bit long integer at the specified absolute {@code index} in

  • this buffer. This method does not modify {@code readerIndex} or

  • {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 8} is greater than {@code this.capacity}
    

*/

public abstract long getLong(int index);

/**

  • Gets a 2-byte UTF-16 character at the specified absolute

  • {@code index} in this buffer. This method does not modify

  • {@code readerIndex} or {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 2} is greater than {@code this.capacity}
    

*/

public abstract char getChar(int index);

/**

  • Gets a 32-bit floating point number at the specified absolute

  • {@code index} in this buffer. This method does not modify

  • {@code readerIndex} or {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 4} is greater than {@code this.capacity}
    

*/

public abstract float getFloat(int index);

/**

  • Gets a 64-bit floating point number at the specified absolute

  • {@code index} in this buffer. This method does not modify

  • {@code readerIndex} or {@code writerIndex} of this buffer.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     {@code index + 8} is greater than {@code this.capacity}
    

*/

public abstract double getDouble(int index);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the specified absolute {@code index} until the destination becomes

  • non-writable. This method is basically same with

  • {@link #getBytes(int, ByteBuf, int, int)}, except that this

  • method increases the {@code writerIndex} of the destination by the

  • number of the transferred bytes while

  • {@link #getBytes(int, ByteBuf, int, int)} does not.

  • This method does not modify {@code readerIndex} or {@code writerIndex} of

  • the source buffer (i.e. {@code this}).

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     if {@code index + dst.writableBytes} is greater than
    
  •        {@code this.capacity}
    

*/

public abstract ByteBuf getBytes(int index, ByteBuf dst);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the specified absolute {@code index}. This method is basically same

  • with {@link #getBytes(int, ByteBuf, int, int)}, except that this

  • method increases the {@code writerIndex} of the destination by the

  • number of the transferred bytes while

  • {@link #getBytes(int, ByteBuf, int, int)} does not.

  • This method does not modify {@code readerIndex} or {@code writerIndex} of

  • the source buffer (i.e. {@code this}).

  • @param length the number of bytes to transfer

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0},
    
  •     if {@code index + length} is greater than
    
  •        {@code this.capacity}, or
    
  •     if {@code length} is greater than {@code dst.writableBytes}
    

*/

public abstract ByteBuf getBytes(int index, ByteBuf dst, int length);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the specified absolute {@code index}.

  • This method does not modify {@code readerIndex} or {@code writerIndex}

  • of both the source (i.e. {@code this}) and the destination.

  • @param dstIndex the first index of the destination

  • @param length the number of bytes to transfer

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0},
    
  •     if the specified {@code dstIndex} is less than {@code 0},
    
  •     if {@code index + length} is greater than
    
  •        {@code this.capacity}, or
    
  •     if {@code dstIndex + length} is greater than
    
  •        {@code dst.capacity}
    

*/

public abstract ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the specified absolute {@code index}.

  • This method does not modify {@code readerIndex} or {@code writerIndex} of

  • this buffer

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     if {@code index + dst.length} is greater than
    
  •        {@code this.capacity}
    

*/

public abstract ByteBuf getBytes(int index, byte[] dst);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the specified absolute {@code index}.

  • This method does not modify {@code readerIndex} or {@code writerIndex}

  • of this buffer.

  • @param dstIndex the first index of the destination

  • @param length the number of bytes to transfer

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0},
    
  •     if the specified {@code dstIndex} is less than {@code 0},
    
  •     if {@code index + length} is greater than
    
  •        {@code this.capacity}, or
    
  •     if {@code dstIndex + length} is greater than
    
  •        {@code dst.length}
    

*/

public abstract ByteBuf getBytes(int index, byte[] dst, int dstIndex, int length);

/**

  • Transfers this buffer’s data to the specified destination starting at

  • the specified absolute {@code index} until the destination’s position

  • reaches its limit.

  • This method does not modify {@code readerIndex} or {@code writerIndex} of

  • this buffer while the destination’s {@code position} will be increased.

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     if {@code index + dst.remaining()} is greater than
    
  •        {@code this.capacity}
    

*/

public abstract ByteBuf getBytes(int index, ByteBuffer dst);

/**

  • Transfers this buffer’s data to the specified stream starting at the

  • specified absolute {@code index}.

  • This method does not modify {@code readerIndex} or {@code writerIndex} of

  • this buffer.

  • @param length the number of bytes to transfer

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     if {@code index + length} is greater than
    
  •        {@code this.capacity}
    
  • @throws IOException

  •     if the specified stream threw an exception during I/O
    

*/

public abstract ByteBuf getBytes(int index, OutputStream out, int length) throws IOException;

/**

  • Transfers this buffer’s data to the specified channel starting at the

  • specified absolute {@code index}.

  • This method does not modify {@code readerIndex} or {@code writerIndex} of

  • this buffer.

  • @param length the maximum number of bytes to transfer

  • @return the actual number of bytes written out to the specified channel

  • @throws IndexOutOfBoundsException

  •     if the specified {@code index} is less than {@code 0} or
    
  •     if {@code index + length} is greater than
    
  •        {@code this.capacity}
    
  • @throws IOException

  •     if the specified channel threw an exception during I/O
    

*/

public abstract int getBytes(int index, GatheringByteChannel out, int length) throws IOException;

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
img
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加V获取:vip1024b (备注Java)
img

最后总结我的面试经验

2021年的金三银四一眨眼就到了,对于很多人来说是跳槽的好机会,大厂面试远没有我们想的那么困难,摆好心态,做好准备,你也可以的。

另外,面试中遇到不会的问题不妨尝试讲讲自己的思路,因为有些问题不是考察我们的编程能力,而是逻辑思维表达能力;最后平时要进行自我分析与评价,做好职业规划,不断摸索,提高自己的编程能力和抽象思维能力。

BAT面试经验

实战系列:Spring全家桶+Redis等

其他相关的电子书:源码+调优

面试真题:

一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
img

el out, int length) throws IOException;

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
[外链图片转存中…(img-9CSeN8Um-1712754825070)]
[外链图片转存中…(img-FYnhCzEU-1712754825070)]
[外链图片转存中…(img-XnglvEZy-1712754825071)]
[外链图片转存中…(img-pkAx2okQ-1712754825071)]
[外链图片转存中…(img-SbHBwzAz-1712754825071)]
[外链图片转存中…(img-KBcAxNrE-1712754825072)]

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加V获取:vip1024b (备注Java)
[外链图片转存中…(img-sA5kbFbI-1712754825072)]

最后总结我的面试经验

2021年的金三银四一眨眼就到了,对于很多人来说是跳槽的好机会,大厂面试远没有我们想的那么困难,摆好心态,做好准备,你也可以的。

另外,面试中遇到不会的问题不妨尝试讲讲自己的思路,因为有些问题不是考察我们的编程能力,而是逻辑思维表达能力;最后平时要进行自我分析与评价,做好职业规划,不断摸索,提高自己的编程能力和抽象思维能力。

[外链图片转存中…(img-ekDk0HEN-1712754825072)]

BAT面试经验

实战系列:Spring全家桶+Redis等

[外链图片转存中…(img-DhMeeolQ-1712754825073)]

其他相关的电子书:源码+调优

[外链图片转存中…(img-vogn4nUg-1712754825073)]

面试真题:

[外链图片转存中…(img-QvbRw5TK-1712754825073)]

[外链图片转存中…(img-Lq8z53pp-1712754825074)]

一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
[外链图片转存中…(img-JDmEaSnb-1712754825074)]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值