RXTX Return String2019 Community Moderator ElectionHow to generate a random alpha-numeric string?How do I read / convert an InputStream into a String in Java?How to get an enum value from a string value in Java?How to split a string in JavaHow do I convert a String to an int in Java?Why is char[] preferred over String for passwords?Why does this code using random strings print “hello world”?HttpServletRequest InputStream read return -1Working on a java based chatting application using threadingJava : URLConnection setRequestProperty range issue relying on multithreaded process?

How to balance a monster modification (zombie)?

Have the tides ever turned twice on any open problem?

Have any astronauts/cosmonauts died in space?

What will the Frenchman say?

Do native speakers use "ultima" and "proxima" frequently in spoken English?

Unfrosted light bulb

Is there any common country to visit for uk and schengen visa?

What are the consequences of changing the number of hours in a day?

How to understand 「僕は誰より彼女が好きなんだ。」

Are hand made posters acceptable in Academia?

How do you justify more code being written by following clean code practices?

Asserting that Atheism and Theism are both faith based positions

Unable to get newly inserted Product's Id using After Plugin for Catalog Product save controller method

Error in master's thesis, I do not know what to do

Animating wave motion in water

Gauss brackets with double vertical lines

Should I be concerned about student access to a test bank?

Why didn’t Eve recognize the little cockroach as a living organism?

What is the difference between something being completely legal and being completely decriminalized?

Symbolism of 18 Journeyers

How to read string as hex number in bash?

label a part of commutative diagram

How are passwords stolen from companies if they only store hashes?

Why doesn't the fusion process of the sun speed up?



RXTX Return String



2019 Community Moderator ElectionHow to generate a random alpha-numeric string?How do I read / convert an InputStream into a String in Java?How to get an enum value from a string value in Java?How to split a string in JavaHow do I convert a String to an int in Java?Why is char[] preferred over String for passwords?Why does this code using random strings print “hello world”?HttpServletRequest InputStream read return -1Working on a java based chatting application using threadingJava : URLConnection setRequestProperty range issue relying on multithreaded process?










-4















I'm using RXTX library for working with arduino.And i'm try to write class on java who can read data in string.
When i'm use RXTX TwoSerialComm tutorial and try to return String it isn't work!! How do it? TwoSeriallCom tutorial is here 1 How do it?



 public static class SerialReader implements Runnable 

InputStream in;

public SerialReader ( InputStream in )

this.in = in;


public void run ()

byte[] buffer = new byte[1024];
int len = -1;
try

while ( ( len = this.in.read(buffer)) > -1 )

System.out.print(new String(buffer,0,len));


catch ( IOException e )

e.printStackTrace();





How do it ?










share|improve this question



















  • 3





    Can you please add to your post what you have tried (and what is not working with your correct attempt), and an example of what you WANT to accomplish?

    – Jerry M.
    Mar 7 at 19:09











  • I try just add platform and return string !!

    – Alex Zaslavskis
    Mar 7 at 19:15











  • With your question, it's unclear what you are trying to achieve, please add more information here.

    – vancleff
    Mar 7 at 19:16






  • 1





    Please read "How to create a Minimal, Complete, and Verifiable example". Then use the edit link to improve your question (do not add more information via comments). Otherwise we are not able to answer your question and help you.

    – GhostCat
    Mar 7 at 19:16






  • 1





    Dont just link to some tutorial: show us the code you are using. Dont expect other people to first digest some tutorial, to then guess what you might be doing or intend to do, to drop a solution for you.

    – GhostCat
    Mar 7 at 19:17















-4















I'm using RXTX library for working with arduino.And i'm try to write class on java who can read data in string.
When i'm use RXTX TwoSerialComm tutorial and try to return String it isn't work!! How do it? TwoSeriallCom tutorial is here 1 How do it?



 public static class SerialReader implements Runnable 

InputStream in;

public SerialReader ( InputStream in )

this.in = in;


public void run ()

byte[] buffer = new byte[1024];
int len = -1;
try

while ( ( len = this.in.read(buffer)) > -1 )

System.out.print(new String(buffer,0,len));


catch ( IOException e )

e.printStackTrace();





How do it ?










share|improve this question



















  • 3





    Can you please add to your post what you have tried (and what is not working with your correct attempt), and an example of what you WANT to accomplish?

    – Jerry M.
    Mar 7 at 19:09











  • I try just add platform and return string !!

    – Alex Zaslavskis
    Mar 7 at 19:15











  • With your question, it's unclear what you are trying to achieve, please add more information here.

    – vancleff
    Mar 7 at 19:16






  • 1





    Please read "How to create a Minimal, Complete, and Verifiable example". Then use the edit link to improve your question (do not add more information via comments). Otherwise we are not able to answer your question and help you.

    – GhostCat
    Mar 7 at 19:16






  • 1





    Dont just link to some tutorial: show us the code you are using. Dont expect other people to first digest some tutorial, to then guess what you might be doing or intend to do, to drop a solution for you.

    – GhostCat
    Mar 7 at 19:17













-4












-4








-4


2






I'm using RXTX library for working with arduino.And i'm try to write class on java who can read data in string.
When i'm use RXTX TwoSerialComm tutorial and try to return String it isn't work!! How do it? TwoSeriallCom tutorial is here 1 How do it?



 public static class SerialReader implements Runnable 

InputStream in;

public SerialReader ( InputStream in )

this.in = in;


public void run ()

byte[] buffer = new byte[1024];
int len = -1;
try

while ( ( len = this.in.read(buffer)) > -1 )

System.out.print(new String(buffer,0,len));


catch ( IOException e )

e.printStackTrace();





How do it ?










share|improve this question
















I'm using RXTX library for working with arduino.And i'm try to write class on java who can read data in string.
When i'm use RXTX TwoSerialComm tutorial and try to return String it isn't work!! How do it? TwoSeriallCom tutorial is here 1 How do it?



 public static class SerialReader implements Runnable 

InputStream in;

public SerialReader ( InputStream in )

this.in = in;


public void run ()

byte[] buffer = new byte[1024];
int len = -1;
try

while ( ( len = this.in.read(buffer)) > -1 )

System.out.print(new String(buffer,0,len));


catch ( IOException e )

e.printStackTrace();





How do it ?







java rxtx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 13 at 12:52







Alex Zaslavskis

















asked Mar 7 at 19:03









Alex ZaslavskisAlex Zaslavskis

16




16







  • 3





    Can you please add to your post what you have tried (and what is not working with your correct attempt), and an example of what you WANT to accomplish?

    – Jerry M.
    Mar 7 at 19:09











  • I try just add platform and return string !!

    – Alex Zaslavskis
    Mar 7 at 19:15











  • With your question, it's unclear what you are trying to achieve, please add more information here.

    – vancleff
    Mar 7 at 19:16






  • 1





    Please read "How to create a Minimal, Complete, and Verifiable example". Then use the edit link to improve your question (do not add more information via comments). Otherwise we are not able to answer your question and help you.

    – GhostCat
    Mar 7 at 19:16






  • 1





    Dont just link to some tutorial: show us the code you are using. Dont expect other people to first digest some tutorial, to then guess what you might be doing or intend to do, to drop a solution for you.

    – GhostCat
    Mar 7 at 19:17












  • 3





    Can you please add to your post what you have tried (and what is not working with your correct attempt), and an example of what you WANT to accomplish?

    – Jerry M.
    Mar 7 at 19:09











  • I try just add platform and return string !!

    – Alex Zaslavskis
    Mar 7 at 19:15











  • With your question, it's unclear what you are trying to achieve, please add more information here.

    – vancleff
    Mar 7 at 19:16






  • 1





    Please read "How to create a Minimal, Complete, and Verifiable example". Then use the edit link to improve your question (do not add more information via comments). Otherwise we are not able to answer your question and help you.

    – GhostCat
    Mar 7 at 19:16






  • 1





    Dont just link to some tutorial: show us the code you are using. Dont expect other people to first digest some tutorial, to then guess what you might be doing or intend to do, to drop a solution for you.

    – GhostCat
    Mar 7 at 19:17







3




3





Can you please add to your post what you have tried (and what is not working with your correct attempt), and an example of what you WANT to accomplish?

– Jerry M.
Mar 7 at 19:09





Can you please add to your post what you have tried (and what is not working with your correct attempt), and an example of what you WANT to accomplish?

– Jerry M.
Mar 7 at 19:09













I try just add platform and return string !!

– Alex Zaslavskis
Mar 7 at 19:15





I try just add platform and return string !!

– Alex Zaslavskis
Mar 7 at 19:15













With your question, it's unclear what you are trying to achieve, please add more information here.

– vancleff
Mar 7 at 19:16





With your question, it's unclear what you are trying to achieve, please add more information here.

– vancleff
Mar 7 at 19:16




1




1





Please read "How to create a Minimal, Complete, and Verifiable example". Then use the edit link to improve your question (do not add more information via comments). Otherwise we are not able to answer your question and help you.

– GhostCat
Mar 7 at 19:16





Please read "How to create a Minimal, Complete, and Verifiable example". Then use the edit link to improve your question (do not add more information via comments). Otherwise we are not able to answer your question and help you.

– GhostCat
Mar 7 at 19:16




1




1





Dont just link to some tutorial: show us the code you are using. Dont expect other people to first digest some tutorial, to then guess what you might be doing or intend to do, to drop a solution for you.

– GhostCat
Mar 7 at 19:17





Dont just link to some tutorial: show us the code you are using. Dont expect other people to first digest some tutorial, to then guess what you might be doing or intend to do, to drop a solution for you.

– GhostCat
Mar 7 at 19:17












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55051069%2frxtx-return-string%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55051069%2frxtx-return-string%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page