org.redkale.convert.bson

## 类 BsonConvert

- java.lang.Object
- - org.redkale.convert.Convert<BsonReader,BsonWriter>
  - - org.redkale.convert.bson.BsonConvert

-     public final class BsonConvert
      extends Convert<BsonReader,BsonWriter>

  >      BSON协议格式:
  >       1). 基本数据类型: 直接转换成byte[]
  >       2). SmallString(无特殊字符且长度小于256的字符串): length(1 byte) + byte[](utf8); 通常用于类名、字段名、枚举。
  >       3). String: length(4 bytes) + byte[](utf8);
  >       4). 数组: length(4 bytes) + byte[]...
  >       5). Object:
  >           1. realclass (SmallString) (如果指定格式化的class与实体对象的class不一致才会有该值, 该值可以使用@ConvertEntity给其取个别名)
  >           2. 空字符串(SmallString)
  >           3. SIGN_OBJECTB 标记位，值固定为0xBB (short)
  >           4. 循环字段值:
  >               4.1 SIGN_HASNEXT 标记位，值固定为1 (byte)
  >               4.2 字段类型; 1-9为基本类型和字符串; 101-109为基本类型和字符串的数组; 127为Object
  >               4.3 字段名 (SmallString)
  >               4.4 字段的值Object
  >           5. SIGN_NONEXT 标记位，值固定为0 (byte)
  >           6. SIGN_OBJECTE 标记位，值固定为0xEE (short)

  详情见: http://www.redkale.org

- - ### 字段概要

    - ### 从类继承的字段 org.redkale.convert.Convert

      `factory`

  - ### 构造器概要

    构造器
    限定符 | 构造器和说明
    --- | ---
    `protected` | `BsonConvert(Factory<BsonReader,BsonWriter> factory, boolean tiny)`

  - ### 方法概要

    所有方法 静态方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `<T> T` | `convertFrom(java.lang.reflect.Type type, BsonReader reader)`
    `<T> T` | `convertFrom(java.lang.reflect.Type type, byte[] bytes)`
    `<T> T` | `convertFrom(java.lang.reflect.Type type, byte[] bytes, int start, int len)`
    `<T> T` | `convertFrom(java.lang.reflect.Type type, java.nio.ByteBuffer... buffers)`
    `<T> T` | `convertFrom(java.lang.reflect.Type type, java.io.InputStream in)`
    `void` | `convertTo(BsonWriter writer, java.lang.Object value)`
    `void` | `convertTo(BsonWriter writer, java.lang.reflect.Type type, java.lang.Object value)`
    `byte[]` | `convertTo(java.lang.Object value)`
    `void` | `convertTo(java.io.OutputStream out, java.lang.Object value)`
    `void` | `convertTo(java.io.OutputStream out, java.lang.reflect.Type type, java.lang.Object value)`
    `java.nio.ByteBuffer[]` | `convertTo(java.util.function.Supplier<java.nio.ByteBuffer> supplier, java.lang.Object value)`
    `java.nio.ByteBuffer[]` | `convertTo(java.util.function.Supplier<java.nio.ByteBuffer> supplier, java.lang.reflect.Type type, java.lang.Object value)`
    `byte[]` | `convertTo(java.lang.reflect.Type type, java.lang.Object value)`
    `BsonWriter` | `convertToWriter(java.lang.Object value)`
    `BsonWriter` | `convertToWriter(java.lang.reflect.Type type, java.lang.Object value)`
    `BsonFactory` | `getFactory()`
    `void` | `offerBsonReader(BsonReader in)`
    `void` | `offerBsonWriter(BsonWriter out)`
    `BsonReader` | `pollBsonReader()`
    `BsonReader` | `pollBsonReader(java.nio.ByteBuffer... buffers)`
    `BsonReader` | `pollBsonReader(java.io.InputStream in)`
    `BsonWriter` | `pollBsonWriter()`
    `BsonWriter` | `pollBsonWriter(java.io.OutputStream out)`
    `BsonByteBufferWriter` | `pollBsonWriter(java.util.function.Supplier<java.nio.ByteBuffer> supplier)`
    `static BsonConvert` | `root()`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### BsonConvert

          protected BsonConvert(Factory<BsonReader,BsonWriter> factory,
                                boolean tiny)

  - ### 方法详细资料

    - #### getFactory

          public BsonFactory getFactory()

      覆盖:
        `getFactory` 在类中 `Convert<BsonReader,BsonWriter>`

    - #### root

          public static BsonConvert root()

    - #### pollBsonReader

          public BsonReader pollBsonReader(java.nio.ByteBuffer... buffers)

    - #### pollBsonReader

          public BsonReader pollBsonReader(java.io.InputStream in)

    - #### pollBsonReader

          public BsonReader pollBsonReader()

    - #### offerBsonReader

          public void offerBsonReader(BsonReader in)

    - #### pollBsonWriter

          public BsonByteBufferWriter pollBsonWriter(java.util.function.Supplier<java.nio.ByteBuffer> supplier)

    - #### pollBsonWriter

          public BsonWriter pollBsonWriter(java.io.OutputStream out)

    - #### pollBsonWriter

          public BsonWriter pollBsonWriter()

    - #### offerBsonWriter

          public void offerBsonWriter(BsonWriter out)

    - #### convertFrom

          public <T> T convertFrom(java.lang.reflect.Type type,
                                   byte[] bytes)

    - #### convertFrom

          public <T> T convertFrom(java.lang.reflect.Type type,
                                   byte[] bytes,
                                   int start,
                                   int len)

    - #### convertFrom

          public <T> T convertFrom(java.lang.reflect.Type type,
                                   java.io.InputStream in)

    - #### convertFrom

          public <T> T convertFrom(java.lang.reflect.Type type,
                                   java.nio.ByteBuffer... buffers)

    - #### convertFrom

          public <T> T convertFrom(java.lang.reflect.Type type,
                                   BsonReader reader)

    - #### convertTo

          public byte[] convertTo(java.lang.Object value)

    - #### convertTo

          public byte[] convertTo(java.lang.reflect.Type type,
                                  java.lang.Object value)

    - #### convertTo

          public void convertTo(java.io.OutputStream out,
                                java.lang.Object value)

    - #### convertTo

          public void convertTo(java.io.OutputStream out,
                                java.lang.reflect.Type type,
                                java.lang.Object value)

    - #### convertTo

          public java.nio.ByteBuffer[] convertTo(java.util.function.Supplier<java.nio.ByteBuffer> supplier,
                                                 java.lang.reflect.Type type,
                                                 java.lang.Object value)

    - #### convertTo

          public java.nio.ByteBuffer[] convertTo(java.util.function.Supplier<java.nio.ByteBuffer> supplier,
                                                 java.lang.Object value)

    - #### convertTo

          public void convertTo(BsonWriter writer,
                                java.lang.Object value)

    - #### convertTo

          public void convertTo(BsonWriter writer,
                                java.lang.reflect.Type type,
                                java.lang.Object value)

    - #### convertToWriter

          public BsonWriter convertToWriter(java.lang.Object value)

    - #### convertToWriter

          public BsonWriter convertToWriter(java.lang.reflect.Type type,
                                            java.lang.Object value)