Conversion from char to byte

can anybody to convert char which is unicode in java as one byte. i want to print that byte as ascii.
i tried below method.
char temp='s';
ByteBuffer buff= ByteBuffer.wrap(some byte array of some size);
buff.putChar(temp);
out.writeByte(buff.getChar()); // out is my dataoutput stream which
// stores in some file by using
// fileoutputstream.
in some case i got right output like: s
but in some case i got: sX where X=white space.
so it's still writing as unicode eventhough i called writeByte.
i want to change my program little bit by putting char as byte and not as char in bytebuffer and i want to do something like this after i store my chars as byte
out.writeByte(buff.getByte());
do you have any method to convert char to byte and store it in buff?
thanks a lot.

Try the toBytes() method of the String class.

Similar Messages

  • Conversion from Char to Packed Number

    Hi,
    How do we convert a 18 byte char field(Which contains all numerics) in to a 8 byte field ?
    Regards,
    Hari

    Hi.,,
    what is your actual requirement ??
    if u want to move a character variable which contains all numerics into a P type field u can directly move it !!
    <b>data w_char(18) type c value '1234567'.
    data w_p type p decimals 2.
    move w_char to w_p.
    write w_p.</b>
    <u>If you want to hold large numbers then increase the size of P type variable..</u>
    <u>data w_p<b>(10)</b> type p decimals 2.</u>
    reward if it helps u..
    sai ramesh.

  • Field conversion from char .

    Dear member ,
                Is there any way to reduce the prefix zero from sale order 10 digit char .
               EG: if 0053549980 is the so no I want to make it 53549980  . I have transfered  the vale into integer variable but error is coming  data overflow .
    Help me to find out the solution .
    Regards ,
    Joy .

    Hi Joy,
    Try using the PACK keyword to remove the leading zeros.
    PACK <var1> TO <var2>.
    CONDENSE <var2>.
    Here var1 and var2 both are Character Type variables.
    Hope it helps.
    Regards,
    Himanshu

  • Conversion from char to date

    I have a filename as final_20120928_142334.txt
    I have to get only date value from this as 20120928_142334
    then I have to convert this into date time format as yyyymmdd hh24:mi:ss

    To extract the actual filename into a table, use the code for the 'Retrieve File List' example in this document - on page 8.
    http://s3.amazonaws.com/Ora/ODI_Waiting_for_a_file_and_processing_it.pdf
    Then use the expression posted by 955950 above to format the string.
    Edited by: _Phil on Sep 28, 2012 11:48 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Deprecated conversion from string constant to 'char*'

    Hi all
    I am working with strings and i cant figure out why the following
    warning appears at time of build.
    warning: deprecated conversion from string constant to 'char*'
    It appears for the line
    char *myName = "Apple.txt";
    Is there anyone who can help me?
    Help is welcome.
    Thanks in advance.

    Any reason why you aren't using NSString in place of char?
    char *myName = "Apple.txt";
    NSString *myName = @"Apple.txt";

  • Conversion from string "20041023 " to type 'Date' is not valid.

    Hi ,
       I have a table with one of the column(EmpHiredate) datatype is char(10). It has value like "20141023". I need to display this value as date format(dd/mm/yyyy) in report. 
    Following methods i tried in textbox expression but no luck.
    =Format(Fields!EmpHireDate.Value,"dd/MM/yyyy")
    =Cdate(Fields!EmpHireDate.Value)
    Error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "20041023  " to type 'Date' is not valid.
    Is it possible to convert string to date using SSRS textbox expression ? Can anyone help me with the solution.
    Thanks,
    Kittu

    Hi Jmcmullen,
         Found one more issue on the same. I have one value like "00000000" for the column(EmpHiredate)
    , when i use above expression values(ex:"20141023")
    are displaying in dd/MM/yyyy format in report except value like "00000000" and giving following error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "0000/00/00" to type 'Date' is not valid.
    Even i tried to pass its original value("00000000") as below but no luck.
    =IIF(Fields!EmpHireDate.Value = "00000000","00000000",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Also tried this:
    =IIF(Fields!EmpHireDate.Value = "00000000","2000/10/21",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Please Suggest. 
    Thanks ,
    Kittu

  • Invalid UTF-8 middle byte 0x6f (at char #3309, byte #2895)

    Hello Oracle Support/ SOA Experts,
    Please guide me on how to resolve this issue.
    Issue Description : We are using ATG,Oracle SoA SUite 11g as the Front and Middleware applications for our current website project.The project is basically for latin america(Portuguese Language) and we are facing encoding issue while sending the request from ATG(Front End) to SOA (Middleware).We have an SOA-xsd [customer.xsd) that contains FirstName,LastName,MiddleName as elements.Front End application(ATG) sends the customer xsd in ISO-8859-1 encoding format as we understood that only encoding format for sending the portuguese names is this format.Front is able to send the request to SOA Without any issues however the only format which SOA Suite accepts in our BPEL process is UTF-8 and hence we are seeing this invalid UTF-8 error.Can anyone of you please explain us on how to resolve this issue or please guide us which encoding format can we use for passing portuguese characters from front end to SOA Suite.
    *Exception*:
                java.lang.RuntimeException: [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0x6f (at char #3309, byte #2895): [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0x6f (at char #3309, byte #2895)
    What we tried :
    Since ATG or front end is using the ISO-8859-1 format to send the request to SOA,we tried to use the encoding format in all the SOA BPEL XSD but we are unable to deploy after changing the encoding and we see the below error :
    Exception:
    Redeploying on /Farm_soa2_domain/soa2_domain/soa_server1 ...
    Redeploying on "/Farm_soa2_domain/soa2_domain/soa_server1" failed!
    Error during deployment/undeployment: oracle.mds.transfer.TransferException:
    MDS-00001: exception in Metadata Services layer
    MDS-00521: error while reading document /deployed-composites/default/ManageCustomerOrderOrchestration_rev1.0/xsd/ManageContract.xsd from metadata repository
    IS0-8859-1
    IS0-8859-1
    MDS-00001: exception in Metadata Services layer
    MDS-00521: error while reading document /deployed-composites/default/ManageCustomerOrderOrchestration_rev1.0/xsd/ManageContract.xsd from metadata repository
    IS0-8859-1
    IS0-8859-1

    Hello Oracle Support/ SOA Experts,
    Please guide me on how to resolve this issue.
    Issue Description : We are using ATG,Oracle SoA SUite 11g as the Front and Middleware applications for our current website project.The project is basically for latin america(Portuguese Language) and we are facing encoding issue while sending the request from ATG(Front End) to SOA (Middleware).We have an SOA-xsd [customer.xsd) that contains FirstName,LastName,MiddleName as elements.Front End application(ATG) sends the customer xsd in ISO-8859-1 encoding format as we understood that only encoding format for sending the portuguese names is this format.Front is able to send the request to SOA Without any issues however the only format which SOA Suite accepts in our BPEL process is UTF-8 and hence we are seeing this invalid UTF-8 error.Can anyone of you please explain us on how to resolve this issue or please guide us which encoding format can we use for passing portuguese characters from front end to SOA Suite.
    *Exception*:
                java.lang.RuntimeException: [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0x6f (at char #3309, byte #2895): [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0x6f (at char #3309, byte #2895)
    What we tried :
    Since ATG or front end is using the ISO-8859-1 format to send the request to SOA,we tried to use the encoding format in all the SOA BPEL XSD but we are unable to deploy after changing the encoding and we see the below error :
    Exception:
    Redeploying on /Farm_soa2_domain/soa2_domain/soa_server1 ...
    Redeploying on "/Farm_soa2_domain/soa2_domain/soa_server1" failed!
    Error during deployment/undeployment: oracle.mds.transfer.TransferException:
    MDS-00001: exception in Metadata Services layer
    MDS-00521: error while reading document /deployed-composites/default/ManageCustomerOrderOrchestration_rev1.0/xsd/ManageContract.xsd from metadata repository
    IS0-8859-1
    IS0-8859-1
    MDS-00001: exception in Metadata Services layer
    MDS-00521: error while reading document /deployed-composites/default/ManageCustomerOrderOrchestration_rev1.0/xsd/ManageContract.xsd from metadata repository
    IS0-8859-1
    IS0-8859-1

  • Getting ÿþ as saved conversations from Lync in Outlook in Office 2013

    Hi,
    I've been trying to get to the bottom of this and have found similar posts, but no one seems to have an answer.
    When I IM someone using Lync 2013, they get a pop up notification but instead of the message they see ÿþ<.  Once they open the chat window, they can see my typed text.  Occasionally, certain people can't see the first line of my chat, but as
    long as they keep the chat window open, they can see everything new I type.
    All my conversations that are saved in outlook show ÿþ< for the text and are unreadable.  I've disabled the saving of conversations because they have become worthless.
    I believe it has to do with BOM but have not been able to find a way to fix this.
    If I copy a conversation from the chat window and paste it into Microsoft Word it shows ÿþ<, but if I paste it into notepad the conversation appears.
    (I had inserted a screenshot here, but am unable to because I am unable to figure out how to get my account "verified")
    I've tried changing the preferred encoding for outgoing messages: to Unicode (UTF-8) in Outlook, but this had no effect and I can't find a similar option in Lync 2013.
    (I had inserted a screenshot here, but am unable to because I am unable to figure out how to get my account "verified")
    I enabled logging for Lync and the event IDs that come up are 1, 11 and 12, to which I cannot find any information for at the moment.
    Any help and or suggestions would be appreciated.

    Hi,
    Did the issue happen only for you or for multiple users?
    Please try to delete Lync User Profile and information on Registry, then repair Office 2013.
    The path of Lync User Profile: %UserProfile%\AppData\Local\Microsoft\Office\15.0\Lync
    The path for information on Registry: HKCU\Software\Microsoft\Office\15.0\Lync\[email protected]
    Then test the issue again.
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • Project Conversion from 11.03 to R12- need help

    Hi All,
    I need some information regarding conversion from 11.03 to R12 along with Capital Project's conversion, do we need to take care Asset Assignment and Assets information at the time of Project Conversion. Iam doing Project and Task conversion different. Is there any good mapping document or Conversion FD, if any body have please send my mail ID. [email protected]
    Thanks for your help.
    Thanks,
    Srini..

    Usually only Open Invoices and Unapplied Receipts are migrated from Old system to New Instance.
    Post Migration Reconciliation shall be tough in that scenario. Reconsider/Rediscuss with Client.
    Migration can be done using APIs or Custom Scripts using Standard Interfaces.
    Hope this is helpful
    Regards,
    Sridhar

  • How can i convert an object to stream of chars or bytes?

    how can i convert an object to stream of chars or bytes?

    One way is the serialization mechanism. There are examples and explanations of it in the Java tutorial: http://java.sun.com/docs/books/tutorial/essential/io/serialization.html

  • Since downloading Firefox 4, I am having problems archiving gmail conversations from my inbox view. Also, when I go to enter a new event in google calendar, I now have to click the cursor in the box to type the event (it used to let me just start typing).

    Since downloading Firefox 4, I am having problems archiving gmail conversations from my inbox view (either one or several conversations) as it says "No Conversations Selected" when I have selected one or several. Also, when I go to enter a new event in google calendar, I have to click the cursor in the box to type the event (it used to let me just start typing) or else it flips out and starts jumping to day view or another month. Does anyone know how to fix either of these?

    I have had this problem; but while trying to fix another problem, I reset my preferences for Firefox and it fixed this problem as well. To reset preferences, follow this link: http://support.mozilla.com/en-US/kb/Resetting%20preferences

  • How can I print a text message conversation from my iPhone? Not using screenshots.

    How can I print a text message conversation from my iPhone? Not using screenshots. It's around 500 messages so screenshots is not a option.

    Yes, you can delete from iphone:
    http://manuals.info.apple.com/enUS/iPhone_iOS4_UserGuide.pdf
    It is covered in the manual.
    Page 172:
    "Delete a podcast: In the Podcasts list in iPod, swipe left or right over the podcast, then
    tap Delete. "

  • Page numbers incorrect after conversion from Excel to pdf

    Page numbers incorrect after conversion from Excel to pdf
    ""This above link (thread:834599) is from a case back in 2011 that claims to solve this problem, but it does not solve this problem. I think that customer only cared about having continuous page numbering, not discrete page numbering per sheet.
    ========================
    I still have this issue in Acrobat XI and MS Office Professional Plus 2010. I keep upgrading to no avail. This regression has resulted in a huge time drain for me. If you fixed it, please explain how I can get my hands on the resolution.
    Previous versions of Excel and Adobe Acrobat enabled flexibility around the "Page #" of "Number of Pages" (Page &[Page] of &[Pages]) token, depending on context and usage. The "# of pages" token could represent EITHER the number of pages in the workbook OR the number of pages in the tab/sheet, depending on how you generated the PDF:
    You could select "Selected Sheets" and then select all or some of the individual sheets in the workbook, and the PDF would honor the discrete numbering of each of the sheets, so the first page of each sheet was p1 and the "# of pages" was the number of pages in the sheet; not the number of pages in the workbook; or
    You could select "Entire Workbook" and the PDF would honor continuous page numbers across all sheets, as a single document.
    Now, it only honors the total number of pages in the workbook, regardless of the method you use to publish to PDF: saving as PDF, printing to PDF, using "createPDF" from Acrobat plugin to Excel's menu ribbon; selecting all sheets, some sheets, or Entire Workbook; automatic First page number or "1" under Page Setup > Page> First page number. (This last option, btw, does restart every sheet at p1, but it hardly makes sense if the total number of pages is still the total number in the workbook instead of the number in the sheet.)
    I spent a lot of time trying each which way that the blog posts recommended and have tried this on multiple versions of Excel and Acrobat now.
    NONE of these time-consuming experiments gave me what I wanted.They all insist that "Page #" of "Number of Pages" (Page &[Page] of &[Pages]) is the total number of pages in the workbook or the total number of pages in the selected sheets combined.
    The numbering are correct in Excel Page Layout.
    The same issue happens when using LibreOffice calc. (Although, I never tested with Libre Office before, so I don't know that it ever worked).
    The workaround now is to create PDF for each spreadsheet one at a time, and then compile them using the Acrobat combine/binder feature. All alternatives are extremely time consuming and tedious. It used to be automatic. This is a major regression that has gone untreated for over a year now, maybe two years.
    My task takes infinitely more time to complete than it did with previous versions of Acrobat. That means that days are added to my project, when the functionality used to enable a quick pdf generation that was ready for review, now I have to do this very manual time-consuming set of steps to generate a draft. As the project has grown and more tabs are added, my pdf-generation task takes that much longer. We require lots of drafts. It used to be easy and fast. Now it is hard and time-consuming.
    In my opinion, the problem is not Excel; it is Acrobat because it was introduced with an upgrade in Acrobat, not an upgrade in Excel. The problem was introduced in Acrobat 9 or 10. Please provide a patch or add-on or something.

    If you are setting up the page numbers in Excel, the resulting PDF would display the the page numbers created in Excel. On Excel 2010 support page, (http://office.microsoft.com/en-us/excel-help/insert-and-remove-page-numbers-on-worksheets- HA010342619.aspx#BM2) is stated the following "tip" which indicates by default Excel 2010 starts numbering each tab with 1. Exel's workaround tip is below - 
    Set a different number for the starting page
    Tip   To number all of the worksheet pages in a workbook sequentially, first add page numbers to all worksheets in a workbook, and then use the following procedure to begin the page number for each worksheet with the appropriate number. For example, if your workbook contains two worksheets that with both be printed as two pages, you would use this procedure to begin the page numbering for the second worksheet with the number 3.
    On the Page Layout tab, in the Page Setup group, click the Dialog Box Launcher next to Page Setup.
    On the Page tab, in the First page number box, type the number that you want to use for the first page.
    Tip   To use the default numbering system, type Auto in the First page number box.
    Also helpful in the same section is the note on viewing page numbers. To see if the page numbering dilemma originates in Excel make sure you are using the Page Layout View see below:
    Hide All
    If you want numbers shown on pages when you print a worksheet  you can insert page numbers in the headers or footers of the worksheet pages. Page numbers that you insert are not displayed on the worksheet in Normal view — they are shown only in Page Layout view and on the printed pages.
    Overall it may be easier not to create the page numbers in Excel but instead create then in Acrobat using the Headers and Footers option in Acrobat.  I hope this helps - it sounds like a frustrating issue you are experiencing.

  • I can´t sync iCal events written in the iphone4 to the macbook ical, but conversely from macbook to iphone there´s no problem, can somebody help me?

    I can´t sync iCal events written in the iphone4 to the macbook ical, but conversely from macbook to iphone there´s no problem, can somebody help me?

    Thanks for your answer! I tried as you say, erase the Sync History, but now does not sync any calendar, only displays the birthday ...do not know whatelse to try.

  • Error while loading : Time conversion from 0CALDAY to 0FISCPER

    Hi ,
           I get the following error when loading to an ODs .
    My 0FISCPER is mapped to one of the date fields from the extractor (Document date) and also Have 0FISCVARNT as part of data fields  .
    " Time conversion from 0CALDAY to 0FISCPER (fiscal year ) failed with value 20060405 " .
    thanks .

    Hello CG
    Please refere this forum
    Time conversion problem
    Thanks
    Chandran

Maybe you are looking for

  • Taxinn-Ecess and Hcess not calculated in MIGO

    Hi All, I have Taxinn in place and in the procedure, i have BED, ECESS and HCESS. The condition for ECESS Setoff and HCESS Setoff are calculated in the Purchase Order, but when am trying to do MIGO with (01 Capture and Post Excise Invoice) in the Exc

  • Contacts Display and Sort by Company Name

    I have over 1000 contacts in Outlook which synced wonderfully with my new iPhone. Alas, I need to lookup and sort by Company Name. This is a VERY standard method for contacts. The options presented by iphone are first and last name, sigh and tech sup

  • NAC 4.7.1 CAS CAM Login issues

    Hello, I upgraded from 4.5.1 to 4.7.1. I am having trouble with the communication between the CAS and the CAM Here is an outline of the issue 1.       After Authentication, DHCP, ACS ok, WALL !!! 2.       Nac Online Users = 0 3.       Ping the CAM HA

  • Oracle VM and Clustering

    Hi All, Is it possible to set up cluster database using Oracle VM? Regards, DBA

  • Changing Colour Display for Temperatur​e Distributi​on

    Hi everyone, I am currently involved in reading a series of temperatures along a length of pipe as part of an experiment.  I thought it would be a nice touch for my VI to have a diagram of the pipe which changes colour to show the temperature distrib