Examples of toByteArray()


Examples of java.io.StringWriter.toByteArray()

        }
        else {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            Result result = new StreamResult(buffer);
            transformer.transform(in.getContent(), result);
            out.setContent(new BytesSource(buffer.toByteArray()));
        }
    }

    /**
     * Should we disable output of the result of the XSLT?
View Full Code Here

Examples of java.math.BigInteger.toByteArray()

    }
   
    private static class BigIntegerColumnSerializer extends ColumnSerializer {
        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
            BigInteger val = (BigInteger)obj;
            byte[] bytes = val.toByteArray();
            out.writeInt(bytes.length);
            out.write(bytes);
        }
        protected Object readObject(ObjectInput in) throws IOException {
            int length = in.readInt();
View Full Code Here

Examples of java.text.CollationKey.toByteArray()

  public void failing_test_toByteArray() {
    // Test for method byte [] java.text.CollationKey.toByteArray()
    Collator collator = Collator.getInstance();
    collator.setStrength(Collator.PRIMARY);
    CollationKey key1 = collator.getCollationKey("abc");
    byte[] bytes = key1.toByteArray();
    assertTrue("Not enough bytes", bytes.length >= 3);

    try {
      collator = new RuleBasedCollator("= 1 , 2 ; 3 , 4 < 5 ; 6 , 7");
    } catch (ParseException e) {
View Full Code Here

Examples of java.util.BitSet.toByteArray()

      String name = ent.getValue();
     
      FieldVisitor fv = cv.visitField(ACC_STATIC, name, Type.getDescriptor(BitSet.class), null, null);
      fv.visitEnd();
     
      byte[] bytes = bs.toByteArray();
      mv.visitLdcInsn(new String(bytes, StandardCharsets.ISO_8859_1));
      mv.visitLdcInsn("ISO-8859-1");
      mv.visitMethodInsn(INVOKEVIRTUAL, Type.getInternalName(String.class),
          "getBytes", "(Ljava/lang/String;)[B");
     
View Full Code Here

Examples of jcifs.ntlmssp.NtlmMessage.toByteArray()

            String password = credentials.substring(domain.length()+user.length()+2);
            Type2Message type2 = (Type2Message) message;
            flags ^= NtlmFlags.NTLMSSP_NEGOTIATE_OEM;
            message = new Type3Message(type2, password, domain, user, null, flags);
        }
        return authMethod + " " + Base64.encode(message.toByteArray());
    }

}
View Full Code Here

Examples of jcifs.ntlmssp.Type1Message.toByteArray()

            Type1Message type1 = (Type1Message) attemptNegotiation(response);
            if (type1 == null) return; // no NTLM
            int attempt = 0;
            while (attempt < MAX_REDIRECTS) {
                connection.setRequestProperty(authProperty, authMethod + ' ' +
                        Base64.encode(type1.toByteArray()));
                connection.connect(); // send type 1
                response = parseResponseCode();
                if (response != HTTP_UNAUTHORIZED &&
                        response != HTTP_PROXY_AUTH) {
                    return;
View Full Code Here

Examples of jcifs.ntlmssp.Type2Message.toByteArray()

        if (msg != null && msg.startsWith("NTLM ")) {
            byte[] src = Base64.decode(msg.substring(5));
            if (src[8] == 1) {
                Type1Message type1 = new Type1Message(src);
                Type2Message type2 = new Type2Message(type1, challenge, null);
                msg = Base64.encode(type2.toByteArray());
                resp.setHeader( "WWW-Authenticate", "NTLM " + msg );
            } else if (src[8] == 3) {
                Type3Message type3 = new Type3Message(src);
                byte[] lmResponse = type3.getLMResponse();
                if (lmResponse == null) lmResponse = new byte[0];
View Full Code Here

Examples of jcifs.ntlmssp.Type3Message.toByteArray()

                }
                Type3Message type3 = (Type3Message)
                        attemptNegotiation(response);
                if (type3 == null) return;
                connection.setRequestProperty(authProperty, authMethod + ' ' +
                        Base64.encode(type3.toByteArray()));
                connection.connect(); // send type 3
                if (cachedOutput != null && doOutput) {
                    OutputStream output = connection.getOutputStream();
                    cachedOutput.writeTo(output);
                    output.flush();
View Full Code Here

Examples of jdbm.helper.OpenByteArrayOutputStream.toByteArray()

      if(keys[i] == null){
        LeadingValueCompressionProvider.writeByteArray(oos, null, previous, 0);
      }else{
        out2.reset();
        ser.serialize(out3,keys[i]);
        byte[] b = out2.toByteArray();
        LeadingValueCompressionProvider.writeByteArray(oos, b, previous, 0);
        previous = b;
      }     
    }
     
View Full Code Here

Examples of jdk.internal.org.objectweb.asm.ClassWriter.toByteArray()

            mv.visitEnd();

            cw.visitEnd();

            // load class
            final byte[] classFile = cw.toByteArray();
            InvokerBytecodeGenerator.maybeDump(className, classFile);
            Class<? extends BoundMethodHandle> bmhClass =
                //UNSAFE.defineAnonymousClass(BoundMethodHandle.class, classFile, null).asSubclass(BoundMethodHandle.class);
                UNSAFE.defineClass(className, classFile, 0, classFile.length,
                                   BoundMethodHandle.class.getClassLoader(), null)
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.