RFC3447 OBJECT IDENTIFIER semantic http://tools.ietf.org/html/rfc3447#appendix-B.1

id-sha256    OBJECT IDENTIFIER ::= {
      joint-iso-itu-t(2) country(16) us(840) organization(1)
      gov(101) csor(3) nistalgorithm(4) hashalgs(2) 1
  }


How to read this definition? In another word, how to convert this into a bit stream? Thanks.
Check out the notes of paragraph 9.2 of that document, it lists all the encodings in hexadecimal values. It does so for PKCS#1 v1.5 padding for signature generation, but it certainly contains the OID's internally - 06 LL { OID } where LL species the length of the BER encoded OID:

For the six hash functions mentioned in Appendix B.1, the DER
encoding T of the DigestInfo value is equal to the following:

  MD2:     (0x) 30 20  30 0c  06 08 2a 86 48 86 f7 0d 02 02  05 00  04 10 || H.
  MD5:     (0x) 30 20  30 0c  06 08 2a 86 48 86 f7 0d 02 05  05 00  04 10 || H.
  SHA-1:   (0x) 30 21  30 09  06 05 2b 0e 03 02 1a 05 00  04 14 || H.
  SHA-256: (0x) 30 31  30 0d  06 09 60 86 48 01 65 03 04 02 01  05 00 04  20 || H.
  SHA-384: (0x) 30 41  30 0d  06 09 60 86 48 01 65 03 04 02 02  05 00 04  30 || H.
  SHA-512: (0x) 30 51  30 0d  06 09 60 86 48 01 65 03 04 02 03  05 00 04  40 || H.

I'll add SHA-224:
  SHA-224: (0x) 30 2D 30 0D 06 09 60 86 48 01 65 03 04 02 04 05 00 04 1C || H.

where || is concatenation and H is the hash value.

The ASN.1 syntax is officially defined in

ISO/IEC 8824: Information technology - Abstract Syntax Notation One (ASN.1): Information object specification

and the BER/DER method of encoding that is applied is specified in

ISO/IEC 8825-1:  Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)

And the OID encoding is in paragraph 8.19 for the 2010 version of that document (an errata exists). How to actually encode it is explained in this answer on StackOverflow