Package org.jruby.util

Examples of org.jruby.util.ByteList.unsafeBytes()


                    // do nothing;
                }
            }
            ByteList bytes = stringData.getByteList();
            if (charset != null) {
                StringReader reader = new StringReader(new String(bytes.unsafeBytes(), bytes.begin(), bytes.length(), charset));
                source.setCharacterStream(reader);
                source.setEncoding(charset.name());
            } else {
                stringDataSize = bytes.length() - bytes.begin();
                ByteArrayInputStream stream = new ByteArrayInputStream(bytes.unsafeBytes(), bytes.begin(), bytes.length());
View Full Code Here


                StringReader reader = new StringReader(new String(bytes.unsafeBytes(), bytes.begin(), bytes.length(), charset));
                source.setCharacterStream(reader);
                source.setEncoding(charset.name());
            } else {
                stringDataSize = bytes.length() - bytes.begin();
                ByteArrayInputStream stream = new ByteArrayInputStream(bytes.unsafeBytes(), bytes.begin(), bytes.length());
                source.setByteStream(stream);
            }
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.