/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
        public virtual ScriptBlock ReadByteCode(Tjs owner, string name, BinaryStream input)
        {
            try
            {
                var br   = new BinaryReader(input.GetInputStream());
                int size = (int)input.GetSize();

                // TJS2
                var tag = br.ReadChars(4).ToRealString();
                if (tag != FILE_TAG_LE)
                {
                    return(null);
                }
                // 100'\0'
                if (br.ReadChars(3).ToRealString() != VER_TAG_LE)
                {
                    return(null);
                }
                br.ReadChar();

                int filesize = br.ReadInt32();
                if (filesize != size)
                {
                    return(null);
                }
                //// DATA
                if (br.ReadChars(4).ToRealString() != DATA_TAG_LE)
                {
                    return(null);
                }
                size = br.ReadInt32();
                ReadDataArea(br, size);
                // これがデータエリア后の位置
                // OBJS
                if (br.ReadChars(4).ToRealString() != OBJ_TAG_LE)
                {
                    return(null);
                }
                //int objsize = ibuff.get();
                ScriptBlock block = new ScriptBlock(owner, name, 0, null, null);
                ReadObjects(block, br);
                return(block);
            }
            finally
            {
                if (mDeleteBuffer)
                {
                    mReadBuffer      = null;
                    mByteArray       = null;
                    mShortArray      = null;
                    mIntArray        = null;
                    mLongArray       = null;
                    mDoubleArray     = null;
                    mDoubleTmpArray  = null;
                    mStringArray     = null;
                    mByteBufferArray = null;
                    mObjectsCache.Release();
                    mVariantTypeData = null;
                }
            }
        }