Sending 80 Byte Fixed Size of File in SAP PI 7.11

Hi, I have a requirement that I need to send the file with approximately 80 bytes or less from SAP PI to a receiver system.
The message that I'm sending is a text file with file sizes that ranges from 200 - 1000 bytes.
Is this even possible in PI?
The only solution that I thought of is zipping the file but it does not guarantee that I will get 80 bytes or less by zipping it.
Thanks,
Roni

Hi,
In receiver determination under conditions choose context objects and select sourceFileSize. The problem is in xpath, there is no way to use less than or equal sign. So only files with exactly 80 bytes would fit the condition.
A choice would be to run a script before message processing that checks filesizes before getting polled.
Regards,
Mark

Similar Messages

  • Hyper-V 2012 R2 - Fixed Size VHDX Have VMs Paused Due to Disk Space Shortage

    I am running Hyper-V Server 2012 R2 (Server Core).  I have an SSD boot drive and a 10 Tb Storage Space HDD (Double Pairty - RAID6) where all VMs are stored.
    I have one VM setup with an expanding VHDX file.  It is setup with thin provisioning for 2 Tb and about 1.5 Tb is currently used.  The VM paused due to physical disk space (SS drive) being low.  I turned off this VM and tried to start a different
    VM that has two fixed size VHDX files (also on the SS drive).  This second VM would not start either.  I got the same error message, as occurred on the first VM, about the physical disk space being low.  There was about 10-20 Mb of physical
    space left of my SS HDD when these errors occurred.
    Given the first VM is setup with an expanding VHDX that makes sense to me that at some point there may not be enough physical disk space for the VM to expand and continue to run.
    But given my second VM is using a fixed VHDX it doesn't make sense to me that I cannot get this VM to start.  Even if the Storage Space disk were completely full I would expect this VM to be able to start?
    Thanks for any assistance you can provide.
    Theokrat

    Hi Theokrat,
    "The HDD was setup with approximately 5 Tb storage pool as double parity."
    "My first VM has a 4 Tb fixed VHDX. Thus there was only about
    1 Tb free space left for the second VM."
    "And for the VMs I'm asking about I set up those options to point to my HDD which is the D drive."
    So, there are two VMs (the first VM has 4TB disk , the
    second VM has 1TB disk )and all of the VMs'  files
    are stored on the 5TB HDD (the 1TB VHDx is dynamical) .
    You turned off the second VM when it was paused due to lacking of disk space (before this the first VM is off ).
    When you start the first VM , it still can not start and the error arose again ,right ?
    If there is no any other factor led to disk usage increasing , I think the issue might be the startup memory of first VM is larger than or equal to the second VM's .
    Please try to check that , if it is true , you can try to set lower memory for the first VM then start it again .
    Best Regards
    Elton JI
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Urgent: DBrefresh error 354 while creating control file, oracle9i, SAP R3

    Hi experts,
    I have created trace file in Source system and moved the same to target system and edited and then while executing the trace file to create control file the following eeror is coming
    my trace file is like this. . .
    STARTUP NOMOUNT
    CREATE CONTROLFILE SET DATABASE "P47" RESETLOGS ARCHIVELOG
    --  SET STANDBY TO MAXIMIZE PERFORMANCE
        MAXLOGFILES 255
        MAXLOGMEMBERS 3
        MAXDATAFILES 336
        MAXINSTANCES 50
        MAXLOGHISTORY 8168
      '/oracle/P47/sapdata9/btabd_63/btabd.data63',
      '/oracle/P47/sapdata9/stabi_27/stabi.data27',
      '/oracle/P47/sapdata9/btabi_122/btabi.data122',
      '/oracle/P47/sapdata9/stabd_28/stabd.data28',
      '/oracle/P47/sapdata9/btabi_123/btabi.data123',
      '/oracle/P47/sapdata9/btabd_64/btabd.data64',
      '/oracle/P47/sapdata9/btabi_124/btabi.data124'
    CHARACTER SET WE8DEC
    i run command like this:
    SQL> @/oracle/P47/saptrace/usertrace/control.sql
    ORACLE instance started.
    Total System Global Area          1249618992 bytes
    Fixed Size                                     732208 bytes
    Variable Size                             788529152 bytes 
    Database Buffers                       459022446 bytes
    Redo Buffers                                1335296 bytes
    <b>354</b>
    when I press 'enter' again SQL prompt is comming
    Please help
    rgds

    Hi markus,
    thanks for reply . .
    control files are not created. . . .
    alertSID logs shows as follows
    orap47> tail -f alert_P47.log
    ARCH shutting down
    Thu Dec 13 13:01:51 2007
    ARC0: Archival stopped
    Thu Dec 13 13:01:51 2007
    ARC1: Archival stopped
    Thu Dec 13 13:01:54 2007
    ARCH: Archiving is disabled
    Shutting down archive processes
    Archiving is disabled
    Archive process shutdown avoided: 0 active
    <b>When @/oracle/saptrace/usertrace/control.sql command given in sepearate SQL window</b>
    Thu Dec 13 13:03:37 2007
    Starting ORACLE instance (normal)
    Disable cache advisory with old cache parameters
    Thu Dec 13 13:03:37 2007
    WARNING: EINVAL creating segment of size 0x000000004b800000
    fix shm parameters in /etc/system or equivalent
    LICENSE_MAX_SESSION = 0
    LICENSE_SESSIONS_WARNING = 0
    SCN scheme 3
    LICENSE_MAX_USERS = 0
    SYS auditing is disabled
    Starting up ORACLE RDBMS Version: 9.2.0.4.0.
    System parameters with non-default values:
      processes                = 80
      sessions                 = 96
      timed_statistics         = TRUE
      shared_pool_size         = 704643072
      enqueue_resources        = 8000
      control_files            = /oracle/P47/sapdata1/cntrl/cntrlP47.dbf, /oracle/P47/sapdata2/cntrl/cntrlP47.dbf, /oracle/P47/sapdata3/cntrl/cntrlP47.dbf
      db_block_buffers         = 56033
      db_block_checksum        = FALSE
      db_block_size            = 8192
      compatible               = 9.2.0
      log_archive_start        = TRUE
      log_archive_dest         = /oracle/P47/saparch/P47arch
      log_buffer               = 1048576
      log_checkpoint_interval  = 0
      db_files                 = 354
      db_file_multiblock_read_count= 8
      log_checkpoints_to_alert = TRUE
      control_file_record_keep_time= 30
      dml_locks                = 2500
      row_locking              = always
      replication_dependency_tracking= FALSE
      transactions_per_rollback_segment= 20
      rollback_segments        = PRS_0, PRS_1, PRS_10, PRS_11, PRS_12, PRS_13, PRS_14, PRS_2, PRS_3, PRS_4, PRS_5, PRS_6, PRS_7, PRS_8, PRS_9
      transaction_auditing     = FALSE
      remote_os_authent        = TRUE
      db_domain                = world
      parallel_max_servers     = 20
      hash_join_enabled        = FALSE
      background_dump_dest     = /oracle/P47/saptrace/background
      user_dump_dest           = /oracle/P47/saptrace/usertrace
      core_dump_dest           = /oracle/P47/saptrace/background
      optimizer_features_enable= 9.2.0
      sort_area_size           = 2097152
      sort_area_retained_size  = 0
      db_name                  = P47
      open_cursors             = 800
      optimizer_mode           = choose
      btree_bitmap_plans     = FALSE
      pushjoin_predicate     = FALSE
      optimizer_index_cost_adj = 10
      newinitial_join_orders = FALSE
      optimpeek_user_binds   = FALSE
    PMON started with pid=2
    DBW0 started with pid=3
    LGWR started with pid=4
    CKPT started with pid=5
    SMON started with pid=6
    RECO started with pid=7
    Thu Dec 13 13:03:39 2007
    ARCH: STARTING ARCH PROCESSES
    ARC0 started with pid=8
    ARC0: Archival started
    ARC1 started with pid=9
    Thu Dec 13 13:03:39 2007
    ARCH: STARTING ARCH PROCESSES COMPLETE
    Thu Dec 13 13:03:39 2007
    ARC0: Thread not mounted
    Thu Dec 13 13:03:39 2007
    ARC1: Archival started
    ARC1: Thread not mounted
    rgds

  • How to resize a jpg/gif file to a fix size using jimi ?

    I have search from the web and didn't find any example on doing this.
    Can any one give example on how to resize a jpg image. let say 120x240
    to a fixed size 40x40 ?
    thank you

    Hi.
    When you got that image in form of a file, just load it and invoke the image's getScaledInstance(...)-method.
    Here's how it could work:
    import java.awt.*;
    public class Test {
    public static void main(String[] argv) {
      // define where the image comes from:
      URL toImage = new URL("file:/C:/test.jpg");  // or the like
      // get the image:
      Image image = Toolkit.getDefaultToolkit().createImage(toImage);
      // scale the image to target size (40x40 here):
      Image smallImage = image.getScaledInstance(40, 40, Image.SCALE_DEFAULT);
      // you might want to do other things like displaying it afterwards
    }HTH & cheers,
    kelysar

  • Have been trying all weekend to upload Jpegs- either Send does not work or shows files uploading then shows error- never had this problem with Send Now-16 images total size 92MB-largest image 13MB

    Have been trying all weekend to upload Jpegs- either Send does not work or shows files uploading then shows error- never had this problem with Send Now-16 images total size 92MB-largest image 13MB

    Hi Ciaran19,
    Are you sending files from the Adobe Send interface, Adobe Reader, or the Outlook plug-in?
    Have you checked to see whether the files that you're sending appear in the Recent Files/Sent Files list when you're logged on to https://cloud.acrobat.com? (It could be that they're uploading, but not being sent.)
    It would also be worthwhile to send the files in smaller batches, to see whether a particular file or files is problematic, and causing the error.
    Please let us know how it goes. If you're still having trouble, please let us know where you're sending from, and whether you're able to send the files in smaller batches. It would also be helpful to know the exact error message that you're receiving.
    Best,
    Sara

  • FILE SENDER ADAPTER -  TO GET A DINAMIC FILE NAME IN THE DIRECTORY

    Hi,
         Please help me.
         I have to read by a file sender adapter a specific file in the directory that its name is Dyyyymmdd, where yyyymmdd is variable according with the current day:
         D      - fixed letter
         yymmdd - year,month and day of the current day.
         I cant´t use D* in the File Name Scheme because I must read only the one file generated in the day.
         How can I configure my file sender adapter to read this especific file in the directory?
          Thanks in advance.
          Mider.

    Hi Krishna,
        I must access only one file by time ( of the current day ), but in the directory I have a lot of them of different dates. I mean, in the of the read ( in the adapter configuration ) , I need to configure the name of the file Dyyyymmdd before of the reading in the directory, in other words, I need to construct the name of file (withe the current date) before the communication channel access the file to read it.
        I think that OS command just can be applicated in file receivers, but if possible, at your purpose, how can I access the name of this especific file via OS command for senders?
        Thanks,
             Mider.
    Message was edited by: Midervilson  Andrade
    Message was edited by: Midervilson  Andrade

  • How to set fixed size for inputfile text field

    Hi all,
    I am using inputfile component to test file uploading so I created a simple upload page. When I finished upload the file, the input text field will "shrink" its size and change the size to adjust the file name. Is there any way to set a fix size for input text field?
    Here is some part of the code:
    <af:form id="f1" usesUpload="true">
    <af:panelHeader text="File Uploader" id="ph1">
    <af:inputFile label="File to upload" id="if1" autoSubmit="true" valueChangeListener="#{fileBean.fileUpdate}"
    value="#{fileBean.file}" partialTriggers="if1"
    columns="50"/>
    </af:panelHeader>
    <af:commandButton text="Save" id="cb1"/>
    FileBean:
    public void fileUpdate(ValueChangeEvent valueChangeEvent) {
    RichInputFile inputFileComponent = (RichInputFile)valueChangeEvent.getComponent();
    UploadedFile newFile = (UploadedFile)valueChangeEvent.getNewValue();
    UploadedFile oldFile = (UploadedFile)valueChangeEvent.getOldValue();
    Thanks,
    Jerry

    you can set columns attribute in af:inputfile. Please see highlighted area i have inserted to you code
    <af:form id="f1" usesUpload="true">
    <af:panelHeader text="File Uploader" id="ph1" columns = "34" >
    <af:inputFile label="File to upload" id="if1" autoSubmit="true" valueChangeListener="#{fileBean.fileUpdate}"
    value="#{fileBean.file}" partialTriggers="if1"
    columns="50"/>
    </af:panelHeader>
    <af:commandButton text="Save" id="cb1"/>

  • Send An Internal Table Via Excel File As An Attachment of E-mail

    Hi,
    I've sent my internal table via Excel file as an attachment of email but all records of internal table are in a row of sended excel file.
    How can i send an internal table via excel file , records of internal table for each rows of excel file,as an attachment of email correctly?
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list     "   t_packing_list-doc_type   =  'XLS'.
                contents_bin               = pit_attach " this is a normal internal table.
                contents_txt               = pit_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.

    Hi,
    CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
    CONSTANTS:
    CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
    CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
          LOOP AT T_FINAL INTO WA_T_FINAL.
            CONCATENATE WA_T_FINAL-PERNR
                        WA_T_FINAL-NAME
                        WA_T_FINAL-LEVEL
                        WA_T_FINAL-POS
                        WA_T_FINAL-JOB
                        WA_T_FINAL-SECTION
                        WA_T_FINAL-DEPT
                        WA_T_FINAL-GROUP
                        WA_T_FINAL-EX_HEAD
                        WA_T_FINAL-SUPID
                        WA_T_FINAL-SUPNM
                        WA_T_FINAL-FHRNM
                        WA_T_FINAL-VACID
                        WA_T_FINAL-VAC_SECTION
                        WA_T_FINAL-VAC_DEPT
                        WA_T_FINAL-VAC_GROUP
                        WA_T_FINAL-VAC_EX_HEAD
                        WA_T_FINAL-VAC_FHRNM
            INTO T_FINAL3 SEPARATED BY CON_TAB.
            CONCATENATE CON_CRET T_FINAL3 INTO T_FINAL3.
            APPEND T_FINAL3.
          ENDLOOP.
    *Fill the document data.
      W_DOC_DATA-DOC_SIZE = 1.
    *Populate the subject/generic message attributes
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'REPORT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE . "mail description
      W_DOC_DATA-SENSITIVTY = 'F'.
    *Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      READ TABLE T_FINAL1 INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
      ( W_CNT - 1 ) * 255 + STRLEN( T_FINAL1 ).
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
      W_DOC_DATA-SENSITIVTY = 'F'.
      CLEAR T_ATTACHMENT.
      REFRESH T_ATTACHMENT.
      T_ATTACHMENT[] = PT_FINAL1[].
    *Describe the body of the message
      CLEAR T_PACKING_LIST.
      REFRESH T_PACKING_LIST.
      T_PACKING_LIST-TRANSF_BIN = SPACE.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 0.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = 'RAW'.
      APPEND T_PACKING_LIST.
    *Create 1st attachment notification
      T_PACKING_LIST-TRANSF_BIN = 'X'.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 1.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
      T_PACKING_LIST-OBJ_DESCR = 'Application 1'.
      T_PACKING_LIST-OBJ_NAME = 'Application 1'.
      T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
      APPEND T_PACKING_LIST.
      CLEAR T_PACKING_LIST.
    *Add the recipients email address
      CLEAR T_RECEIVERS.
      REFRESH T_RECEIVERS.
      T_RECEIVERS-RECEIVER = LD_EMAIL.
      T_RECEIVERS-REC_TYPE = 'U'.
      T_RECEIVERS-COM_TYPE = 'INT'.
      T_RECEIVERS-NOTIF_DEL = 'X'.
      T_RECEIVERS-NOTIF_NDEL = 'X'.
      APPEND T_RECEIVERS.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = W_DOC_DATA
          PUT_IN_OUTBOX              = 'X'
          SENDER_ADDRESS             = LD_SENDER_ADDRESS
          SENDER_ADDRESS_TYPE        = LD_SENDER_ADDRESS_TYPE
          COMMIT_WORK                = 'X'
        IMPORTING
          SENT_TO_ALL                = W_SENT_ALL
        TABLES
          PACKING_LIST               = T_PACKING_LIST
          CONTENTS_BIN               = T_ATTACHMENT
          CONTENTS_TXT               = IT_MESSAGE
          RECEIVERS                  = T_RECEIVERS
        EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
          DOCUMENT_NOT_SENT          = 2
          DOCUMENT_TYPE_NOT_EXIST    = 3
          OPERATION_NO_AUTHORIZATION = 4
          PARAMETER_ERROR            = 5
          X_ERROR                    = 6
          ENQUEUE_ERROR              = 7
          OTHERS                     = 8.
    Edited by: Rahul Ghosh on Apr 6, 2009 6:42 AM

  • How do I alter the bytes of a Class file to add calls to the methods?

    If i had the bytes of a class file, and I wanted to alter the bytes that constitute each method for the class so that it included a call to the security manager, how would i do it?
    1. How would I know which bytes were the opening of a method?
    2. how would I know what the name of the method is?
    3. How would I create bytes for something like:
       SecurityManager sm = System.getSecurityManager().checkPermission(thismeth, subject);
    4. I assume that if by some miracle I can do the above, then all I have to do is call defineClass(...) in ClassLoader and send it the new bytes, right?
    Thanks to all!

    OK, if it will help anyone get me the answers here, I found a class on the internet that can read a class file and tell you where in the bytes a method occurs and what its name is, and how long it is. What I need now is how to convert a call into the correct manner of bytes.
    For example, so I could add the bytes that would do:
       System.out.println("Added!");
    The class that reads a class file:
    /* Inspector.java by Mark D. LaDue */
    /* June 24, 1997 */
    /* Copyright (c) 1997 Mark D. LaDue
       You may study, use, modify, and distribute this example for any purpose.
       This example is provided WITHOUT WARRANTY either expressed or implied.  */
    /* This Java application analyzes the entries in the constant pool and locates
       the code arrays in a Java class file. Each entry in the constant pool
       yields the following information:
       Index     Tag     Reference(s)/Value(s)
       where "Index" is its position within the class file's constant pool,
       "Tag" is the official tag number for that type of entry, and
       "Reference(s)/Value(s)" contains the constant pool information
       according to the entry's type.  (See Lindholm and Yellin's "The Java
       Virtual Machine Specification" for details.)  For each code array in
       the class file, its starting byte, its total length, and the name of
       the method in which it occurs are given.  Combining this information
       with the information yielded by the humble "javap" utility gives one
       sufficient information to hack the code arrays in Java class files. */
    import java.io.*;
    class Inspector {
        public static void main(String[] argv) {
            int fpointer = 8; // Where are we in the class file?
            int cp_entries = 1; // How big is the constant pool?
            int Code_entry = 1; // Where is the entry that denotes "Code"?
            int num_interfaces = 0; // How many interfaces does it use?
            int num_fields = 0; // How many fields are there?
            int num_f_attributes = 0; // How many attributes does a field have?
            int num_methods = 0; // How many methods are there?
            int num_m_attributes = 0; // How many attributes does a method have?
            int[] tags; // Tags for the constant pool entries
            int[] read_ints1; // References for some constant pool entries
            int[] read_ints2; // References for some constant pool entries
            long[] read_longs; // Values for some constant pool entries
            float[] read_floats; // Values for some constant pool entries
            double[] read_doubles; // Values for some constant pool entries
            StringBuffer[] read_strings; // Strings in some constant pool entries
            int[] method_index;
            long[] code_start;
            long[] code_length;
    // How on earth do I use this thing?
            if (argv.length != 1) {
                System.out.println("Try \"java Inspector class_file.class\"");
                System.exit(1);
    // Start by opening the file for reading
            try {
                RandomAccessFile victim = new RandomAccessFile(argv[0], "r");
    // Skip the magic number and versions and start looking at the class file
                victim.seek(fpointer);
    // Determine how many entries there are in the constant pool
                cp_entries = victim.readUnsignedShort();
                fpointer += 2;
    // Set up the arrays of useful information about the constant pool entries
                tags = new int[cp_entries];
                read_ints1 = new int[cp_entries];
                read_ints2 = new int[cp_entries];
                read_longs = new long[cp_entries];
                read_floats = new float[cp_entries];
                read_doubles = new double[cp_entries];
                read_strings = new StringBuffer[cp_entries];
    //Initialize these arrays
                for (int cnt = 0; cnt < cp_entries; cnt++) {
                    tags[cnt] = -1;
                    read_ints1[cnt] = -1;
                    read_ints2[cnt] = -1;
                    read_longs[cnt] = -1;
                    read_floats[cnt] = -1;
                    read_doubles[cnt] = -1;
                    read_strings[cnt] = new StringBuffer();
    // Look at each entry in the constant pool and save the information in it
                for (int i = 1; i < cp_entries; i++) {
                    tags[i] = victim.readUnsignedByte();
                    fpointer++;
                    int skipper = 0;
                    int start = 0;
                    int test_int = 0;
                    switch (tags) {
    case 3: read_ints1[i] = victim.readInt();
    fpointer += 4;
    break;
    case 4: read_floats[i] = victim.readFloat();
    fpointer += 4;
    break;
    case 5: read_longs[i] = victim.readLong();
    fpointer += 8;
    i++;
    break;
    case 6: read_doubles[i] = victim.readDouble();
    fpointer += 8;
    i++;
    break;
    case 7:
    case 8: read_ints1[i] = victim.readUnsignedShort();
    fpointer += 2;
    break;
    case 9:
    case 10:
    case 11:
    case 12: read_ints1[i] = victim.readUnsignedShort();
    fpointer += 2;
    victim.seek(fpointer);
    read_ints2[i] = victim.readUnsignedShort();
    fpointer += 2;
    break;
    // This is the critical case - determine an entry in the constant pool where
    // the string "Code" is found so we can later identify the code attributes
    // for the class's methods
    case 1: skipper = victim.readUnsignedShort();
    start = fpointer;
    fpointer += 2;
    victim.seek(fpointer);
    for (int cnt = 0; cnt < skipper; cnt++) {
    int next = victim.readUnsignedByte();
    switch (next) {
    case 9: read_strings[i].append("\\" + "t");
    break;
    case 10: read_strings[i].append("\\" + "n");
    break;
    case 11: read_strings[i].append("\\" + "v");
    break;
    case 13: read_strings[i].append("\\" + "r");
    break;
    default: read_strings[i].append((char)next);
    break;
    victim.seek(++fpointer);
    victim.seek(start);
    if (skipper == 4) {
    fpointer = start + 2;
    victim.seek(fpointer);
    test_int = victim.readInt();
    if (test_int == 1131373669) {Code_entry = i;}
    fpointer = fpointer + skipper;
    else {fpointer = start + skipper + 2;}
    break;
    victim.seek(fpointer);
    // Skip ahead and see how many interfaces the class implements
    fpointer += 6;
    victim.seek(fpointer);
    num_interfaces = victim.readUnsignedShort();
    // Bypass the interface information
    fpointer = fpointer + 2*(num_interfaces) + 2;
    victim.seek(fpointer);
    // Determine the number of fields
    num_fields = victim.readUnsignedShort();
    // Bypass the field information
    fpointer += 2;
    victim.seek(fpointer);
    for (int j=0; j<num_fields; j++) {
    fpointer += 6;
    victim.seek(fpointer);
    num_f_attributes = victim.readUnsignedShort();
    fpointer = fpointer + 8*(num_f_attributes) + 2;
    victim.seek(fpointer);
    // Determine the number of methods
    num_methods = victim.readUnsignedShort();
    fpointer += 2;
    // Set up the arrays of information about the class's methods
    method_index = new int[num_methods];
    code_start = new long[num_methods];
    code_length = new long[num_methods];
    //Initialize these arrays
    for (int cnt = 0; cnt < num_methods; cnt++) {
    method_index[cnt] = -1;
    code_start[cnt] = -1;
    code_length[cnt] = -1;
    // For each method determine the index of its name and locate its code array
    for (int k=0; k<num_methods; k++) {
    fpointer += 2;
    victim.seek(fpointer);
    method_index[k] = victim.readUnsignedShort();
    fpointer += 4;
    victim.seek(fpointer);
    // Determine the number of attributes for the method
    num_m_attributes = victim.readUnsignedShort();
    fpointer += 2;
    // Test each attribute to see if it's code
    for (int m=0; m<num_m_attributes; m++) {
    int Code_test = victim.readUnsignedShort();
    fpointer += 2;
    // If it is, record the location and length of the code array
    if (Code_test == Code_entry){
    int att_length = victim.readInt();
    int next_method = fpointer + att_length + 4;
    fpointer += 8;
    victim.seek(fpointer);
    code_length[k] = victim.readInt();
    code_start[k] = fpointer + 5;
    fpointer = next_method;
    victim.seek(fpointer);
    // Otherwise just skip it and go on to the next method
    else {
    fpointer = fpointer + victim.readInt() + 4;
    victim.seek(fpointer);
    // Print the information about the Constant Pool
    System.out.println("There are " + (cp_entries - 1) + " + 1 entries in the Constant Pool:\n");
    System.out.println("Index\t" + "Tag\t" + "Reference(s)/Value(s)\t");
    System.out.println("-----\t" + "---\t" + "---------------------\t");
    for (int i = 0; i < cp_entries; i++) {
    switch (tags[i]) {
    case 1: System.out.println(i + "\t" + tags[i] + "\t" + read_strings[i].toString());
    break;
    case 3: System.out.println(i + "\t" + tags[i] + "\t" + read_ints1[i]);
    break;
    case 4: System.out.println(i + "\t" + tags[i] + "\t" + read_floats[i]);
    break;
    case 5: System.out.println(i + "\t" + tags[i] + "\t" + read_longs[i]);
    break;
    case 6: System.out.println(i + "\t" + tags[i] + "\t" + read_doubles[i]);
    break;
    case 7:
    case 8: System.out.println(i + "\t" + tags[i] + "\t" + read_ints1[i]);
    break;
    case 9:
    case 10:
    case 11:
    case 12: System.out.println(i + "\t" + tags[i] + "\t" + read_ints1[i] + " " + read_ints2[i]);
    break;
    System.out.println();
    // Print the information about the methods
    System.out.println("There are " + num_methods + " methods:\n");
    for (int j = 0; j < num_methods; j++) {
    System.out.println("Code array in method " + read_strings[method_index[j]].toString() + " of length " + code_length[j] + " starting at byte " + code_start[j] + ".");
    System.out.println();
    // All the changes are made, so close the file and move along
    victim.close();
    } catch (IOException ioe) {}

  • Byte array size changes

    For some reason the size of my byte arrays change, and it is causing problems using an AES Cipher.
    The length of the byte array is 16 when I first encrypt text, but when I try and decrypt it, it tells me the length is 29. Then I have an IllegalBlockSizeException.
    Can someone explain how to overcome this problem?
    I used the UTF-8 encoding on Ubuntu 8.04

    TamalinJava wrote:
    For some reason the size of my byte arrays change, and it is causing problems using an AES Cipher.A byte[] has a fixed size, you cannot change it.
    The length of the byte array is 16 when I first encrypt text, but when I try and decrypt it, it tells me the length is 29. Then I have an IllegalBlockSizeException.
    I used the UTF-8 encoding on Ubuntu 8.04This is your problem. It translates values >= 128 to be two characters.
    Can someone explain how to overcome this problem?Don't try to write binary data as if it were text. (Write it as binary data)

  • How best to send double byte characters as http params

    Hi all
    I have a web app that accepts text that can be in many languages.
    I build up a http string and send the text as parameters to another webserver. Hence, whatever text I receive i need to be able to represent on a http query string.
    The parameters are sent as urlencoded UTF8. They are decoded by the second webserver back into unicode and saved to the db.
    Occassionally i find a character that i am unable to convert to a utf8 string and send as a parameter (usually a SJIS character). When this occurs, the character is encoded as '3F' - a question mark.
    What is the best way to send double byte characters as http parameters so they always are sent faithfully and not as question marks? Is my only option to use UTF16?
    example code
    <code>
    public class UTF8Test {
    public static void main(String args[]) {
    encodeString("\u7740", "%E7%9D%80"); // encoded UTF8 string contains question mark (3F)
    encodeString("\u65E5", "%E6%97%A5"); // this other japanese character converts fine
    private static void encodeString(String unicode, String expectedResult) {
    try {
    String utf8 = new String(unicode.getBytes("UTF8"));
    String utf16 = new String(unicode.getBytes("UTF16"));
    String encoded = java.net.URLEncoder.encode(utf8);
    String encoded2 = java.net.URLEncoder.encode(utf16);
    System.out.println();
    System.out.println("encoded string is:" + encoded);
    System.out.println("expected encoding result was:" + expectedResult);
    System.out.println();
    System.out.println("encoded string16 is:" + encoded2);
    System.out.println();
    } catch (Exception e) {
    e.printStackTrace();
    </code>
    Any help would be greatly appreciated. I have been struggling with this for quite some time and I can hear the deadline approaching all too quickly
    Thanks
    Matt

    Hi Matt,
    one last visit to the round trip issue:
    in the Sun example, note that UTF8 encoding is used in the method that produces the byte array as well as in the method that creates the second string. This is equivalent to calling:
    String roundTrip = new String(original.getBytes("UTF8"), "UTF8");//sun exampleWhereas, in your code you were calling:
    String utf8 = new String(unicode.getBytes("UTF8"))//Matt's code
    [/code attracted
    The difference is crucial.  When you call the string constructor without a second (encoding) argument, the default encoding (usually Cp1252) is used.  Therefore your code is equivalent toString utf8 = new String(unicode.getBytes("UTF8"), "Cp1252")//Matt's code
    i.e.you are encoding with one transformation format and decoding back with a different transformation format, so in general you won't get your original string back.
    Regarding safely sending multi-byte characters across the Internet, I'm not completely sure what the situation is because I don't do it myself. (When our program is run as an applet, the only interaction it has with the web server is to download various files). I've seen lots of people on this forum describing problems sending multi-byte characters and I can't tell whether the problem is with the software or with the programming. Two possible methods come to mind (of course you need to find out what your third party software is doing):
    1) use the DataOutput/InputStreams writeUTF/readUTF methods
    2) use the InputStreamReader/OutputStreamWriter pair with UTF8 encoding
    See this thread:
    http://forum.java.sun.com/thread.jsp?forum=16&thread=168630
    You should stick to UTF8. It is designed so that the bytes generated by encoding non-ASCII characters can be safely transmitted across the Internet. Bytes generated by UTF16 can be just about anything.
    Here's what I suggest:
    I am running a version of the Sun tutorial that has a program running on a server to which I can send a string and the program sends back the string reversed.
    http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html
    I haven't tried sending multi-byte characters but I will do so and test whether there are any transmission problems. (Assuming that the Sun cgi program itself correctly handles characters).
    More later,
    regards,
    Joe
    P.S.
    I thought one the reasons for the existence of UTF8 was to
    represent things like multi-byte characters in an ascii format?Not exactly. UTF8 encodes ascii characters into single bytes with the same byte values as ASCII encoding. This means that a document consisting entirely of ASCII characters is the same whether it was encoded as UTF8 or ASCII and can consequently be read in any ASCII document reader (e.g.notepad).

  • InsufficientMemoryException while sending large byte array in WCF Service callback

    Hi
    I have a datacontract with a large byte array that is passed by the WCF Service back to the client using a callback contract.
    Until the byte array size remains below 25-30 MB, it is passed OK, but as soon as it exceeds that, an InsufficientMemoryException is thrown on the service side. I have set the max message sizes at 100 MB and using MTOM Encoder.
    I am using WSDualHTTPBinding with sessions and message security - hence streaming is not an option. I know chunking channels are an option, but I want to try to tune the service and client to maximize the byte array size which can be sent over a normal channel.
    Kindly advise how to tune settings to get to around 100 MB byte array size.
    Binding section of web.config is given below. Same settings for sizes are used on client.
    Thanks
    Abhishek
     <wsDualHttpBinding>
            <binding name="WSHttpBinding_IService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
    transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="100000000" maxReceivedMessageSize="100000000" messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true">
              <readerQuotas maxArrayLength="100000000"  />
              <security mode="Message">
                <message clientCredentialType="Certificate" algorithmSuite="Default"  />
              </security>
            </binding>
          </wsDualHttpBinding>

    Hi abhisinghal21,
    >>InsufficientMemoryException while sending large byte array in WCF Service callback
    First please try to increase the timeout value in the both client and service side to see if it works:
    closeTimeout="00:10:00" openTimeout="00:10:00"
    receiveTimeout="00:10:00" sendTimeout="00:10:00"
    Then since you do not want to the use the Chunking option to help you, maybe you try to change the wsDualHttpBinding to use the binding which supports the streaming mode and supports callback.
    In streaming transfer mode, the receiver can begin to process the message before it is completely delivered. And the streaming mode is useful when the information that is passed is lengthy and can be processed serially. Streaming mode is also useful when the
    message is too large to be entirely buffered. So it will be better for you to use the streamed mode.
    For more information, please try to check:
    #How to: Enable Streaming:
    http://msdn.microsoft.com/en-us/library/ms789010(v=vs.110).aspx .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Sending a byte array of greater length than the APDU data buffer

    Hello again, I am now trying to send a byte array of length 480 from the smart card. I've tried setting the outgoing length to 480 first but as i had expected, this threw an exception. Then i tried setting it to 240 and then copying from the array into the apdu buffer in two halves and calling sendBytes() twice, but this only worked the first time - it send the first 240 bytes and then threw an error. Is it possible to do what i am trying to accomplish? If so, what am I missing?

    the applet:
    H:\java_card_kit-2_2_1-win-dom\java_card_kit-2_2_1\samples\src\com\sun\javacard\samples\photocard
    the client:
    H:\java_card_kit-2_2_1-win-dom\java_card_kit-2_2_1\samples\src_client\com\sun\javacard\clientsamples\photocardclient
    here is the code i have used to store large data on card. maybe it will help you.
    i send a series of apdu, where each contains 128 bytes of data (all apdu must have the same length - except the last).
    public void writeAPDU(APDU apdu)
         byte[] buffer = apdu.getBuffer();
         short lc = (short)(buffer[ISO7816.OFFSET_LC]&0xFF);          
         short p1 = (short)(buffer[ISO7816.OFFSET_P1]&0xFF); // counter
         short p2 = (short)(buffer[ISO7816.OFFSET_P2]&0xFF); // length of send data
         short offset = (short)(p1 * p2); // calculate the offset
         apdu.setIncomingAndReceive();
         // check for first apdu (contains the total size of data)
         if(p1 == 0 && p2 == 0)
              short l = Util.getShort(buffer,ISO7816.OFFSET_CDATA);
              data = new byte[l];
         else
              // store bytes in array
              Util.arrayCopy(buffer, ISO7816.OFFSET_CDATA, data, offset, lc);
    }

  • Setting fixed size screen resolution in Arch VirtualBox guests...

    Hello everyone.,
    I've installed an Arch Linux 64-bit guest os in Windows 7 64-bit host. And i've also installed guest additions succesfully.
    Now I need to restrict X to 720x1280 (720p) screen size for screen capturing.
    I've already tried few methods for resizing it:
    1) Tried disabling AutoResize in VirtualBox.
    2) Tried to hint the display size in global settings (VirtualBox => File => Preferences => Display), but when I enter X it fits automatically the whole window again.
    3) Tried to write a configuration file in "/etc/X11/xorg.conf.d/90-monitor.conf" (as explained in Xorg wiki page), but it still doesn't work. I couldn't find my monitor Identifier name, tried several ("VBox0", "Screen0", etc...)
    4) Tried to generate single Xorg conf file ("sudo Xorg -configure"), but it terminates with error: "Missing output drivers. Configuration Failed".
    And also i've googled anything related to fixed size screen WITH guest additions (which I still need for shared folders), seems nobody actually asked for it.
    Any help will be appriciated, thanks.,

    What is native resolution? 1080?
    Do you need a window with guest os smaller than host video?
    Did you try to set resolution on X guest and enabling autoscaled feature in VirtualBox?

  • [svn:osmf:] 14036: Tweaking sample to have the parallel element use a fixed size.

    Revision: 14036
    Revision: 14036
    Author:   [email protected]
    Date:     2010-02-08 06:31:10 -0800 (Mon, 08 Feb 2010)
    Log Message:
    Tweaking sample to have the parallel element use a fixed size.
    Modified Paths:
        osmf/trunk/apps/samples/framework/LayoutSample/src/LayoutSample.as

    Hi,
    thank you for your fast reply. Please find attached my code where I marked the array creation with green circles and the control part with a red one. I removed all the other stuff and loops which are not relevant here (heart beat loop, value initialization, DMA fifo, etc). The sampling rate should be up to 50kS/s for capturing signals with a frequency of the range of 10 to 500Hz).
    @ Spectre Dave:
    I would like to do it in the FPGA because my host part (cRIO PPC) is already overloaded and I had a lot of problems to get it running and save the data to a file with the high sampling rate (50kS/s). I was thinking that simple array functions would be an easy thing for an FPGA. Or am I wrong??
    Please let me know if you have any idea or if you need more information.
    Thank you very much and best regards
    Andreas
    Attachments:
    FPGAarrayProblem.png ‏189 KB

Maybe you are looking for

  • Opening video (MPEG) files on a Mac

    I recently switched from a PC to IMac. Transferred all my video files to my Mac but each time I try to open one I am told it can not be opened as Quicktime does not recognize the file. Any help appreciated

  • Update/Modify not working

    hi, i have ztable mandt key field ztest1  key field ztest2  key field ztest2  non key field when i'm trying to modify any key field, MODIFY keyword is actually adding a new record in the Database. it is because the new combination of key fields is un

  • Maximum of 1363 playlists for iPod sync?

    I have iTunes sync selected playlists to my iPods, but I have encountered what appears to be a playlist limit to do this. I have a very large library (+18k songs) and a large number of playlists (around 1400). iTunes does not show any playlists after

  • X-CAN sample project problem

    Hey guys, I´m getting started with the myRIO-1900 and try to connect it with my car via X-CAN module with OBD-II BD9 cable to collect and record data from my car. I've installed Labview 2014, X-CAN, realtime module in my computer without any problem.

  • KeyStore/ Certificates stored by the JRE Runtime

    Hi! I use this code KeyStore ks = KeyStore.getInstance("pkcs12"); ks.load(new FileInputStream("test.p12", "password".toCharArray()); to load a certificate for signing a PDF with the help of iText. The code works fine. The same certificate was importe