Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSMutableData.bytes()


        data.appendByte((byte) ((bits >>> 24) & 0xff));
        data.appendByte((byte) ((bits >>> 16) & 0xff));
        data.appendByte((byte) ((bits >>> 8) & 0xff));
        data.appendByte((byte) ((bits >>> 0) & 0xff));
      }
      return data.bytes();
    }

    /**
     * string 0101 nnnn [int] ... // ASCII string, nnnn is # of chars, else 1111 then int count, then bytes <br/>
     * string 0110 nnnn [int] ... // Unicode string, nnnn is # of chars, else 1111 then int count, then big-endian 2-byte shorts
View Full Code Here


          }
          theBytes = value.getBytes(encoding);
          data.appendBytes(encodeCount(value.length(), Type.kCFBinaryPlistMarkerUnicode16String));
        }
        data.appendBytes(theBytes);
        return data.bytes();
      }
      catch (UnsupportedEncodingException e) {
        throw NSForwardException._runtimeExceptionForThrowable(e);
      }
    }
View Full Code Here

      data.appendByte((byte) ((bits >>> 32) & 0xff));
      data.appendByte((byte) ((bits >>> 24) & 0xff));
      data.appendByte((byte) ((bits >>> 16) & 0xff));
      data.appendByte((byte) ((bits >>> 8) & 0xff));
      data.appendByte((byte) ((bits >>> 0) & 0xff));
      return data.bytes();
    }

    /*
     * data 0100 nnnn [int] ... // nnnn is number of bytes unless 1111 then int count follows, followed by bytes
     */
 
View Full Code Here

     */
    private byte[] encodeData(byte[] theData) {
      NSMutableData data = new NSMutableData(theData.length + 8);
      data.appendBytes(encodeCount(theData.length, Type.kCFBinaryPlistMarkerData));
      data.appendBytes(theData);
      return data.bytes();
    }

  }

  protected ERXPropertyListSerialization() {
View Full Code Here

        data.appendByte((byte) typeMarker(Type.kCFBinaryPlistMarkerInt, 0));
        data.appendByte((byte) ((value >>> 0) & 0xff));
      } else {
        data.appendByte((byte) typeMarker(marker, (byte) (value & 0x0f)));
      }
      return data.bytes();
    }

    /**
     * int 0001 nnnn ... // # of bytes is 2^nnnn, big-endian bytes
     *
 
View Full Code Here

      } else {
        data.appendByte((byte) typeMarker(Type.kCFBinaryPlistMarkerInt, 1));
        data.appendByte((byte) ((value >>> 8) & 0xff));
        data.appendByte((byte) ((value >>> 0) & 0xff));
      }
      return data.bytes();
    }

    /**
     * uid 1000 nnnn ... // nnnn+1 is # of bytes
     *
 
View Full Code Here

      data.appendByte((byte) ((leastSigBits >>> 24) & 0xff));
      data.appendByte((byte) ((leastSigBits >>> 16) & 0xff));
      data.appendByte((byte) ((leastSigBits >>> 8) & 0xff));
      data.appendByte((byte) ((leastSigBits >>> 0) & 0xff));

      return data.bytes();
    }

    /**
     * real 0010 nnnn ... // # of bytes is 2^nnnn, big-endian bytes
     */
 
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.