BlockDataOutputStream.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:TayzGrid 作者:
/**
     * Writes the given string in UTF format.  This method is used in
     * situations where the UTF encoding length of the string is already
     * known; specifying it explicitly avoids a prescan of the string to
     * determine its UTF length.
     */
    void writeUTF(String s, int utflen) throws IOException
    {
        if (utflen > 0xFFFFL)
        {
            throw new UTFDataFormatException();
        }

        writeInt(utflen);
//        write7BitEncodedInt(utflen);
        //writeShort((int) utflen);
        if (utflen == (long) s.length())
        {
            writeBytes(s);
        }
        else
        {
            writeUTFBody(s);
        }
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号